import LoginComponent from "@/components/login";
import {parse} from "next-useragent";
import {WithoutAuthMiddleware} from "@witel/webapp-builder";

export default function Login() {
    return (
        <WithoutAuthMiddleware defaultUrl={'/'}>
            <LoginComponent/>
        </WithoutAuthMiddleware>
    );
}

export async function getServerSideProps({req, locale}) {
    const {isBot} = parse(req.headers["user-agent"]);
    return {
        props: {
            messages: (await import(`&/locales/${locale}/app.json`)).default,
            title: "Titles.title_login_page",
            isBot,
        },
    };
}
