import { redirect } from "next/navigation"; import { Card, Center, Stack, Text, Title } from "@mantine/core"; import { env } from "@homarr/auth/env"; import { auth } from "@homarr/auth/next"; import { getScopedI18n } from "@homarr/translation/server"; import { HomarrLogoWithTitle } from "~/components/layout/logo/homarr-logo"; import { LoginForm } from "./_login-form"; interface LoginProps { searchParams: Promise<{ callbackUrl?: string; }>; } export default async function Login(props: LoginProps) { const searchParams = await props.searchParams; const session = await auth(); if (session) { redirect(searchParams.callbackUrl ?? "/"); } const t = await getScopedI18n("user.page.login"); return (
{t("title")} {t("subtitle")}
); }