import type { Metadata } from "next"; import NextLink from "next/link"; import { redirect } from "next/navigation"; import { Link } from "@unlocalhosted/metalui"; import { LoginForm } from "@/components/auth-forms"; import { BRAND, LogoMark } from "@/components/brand"; import { Alert, Box } from "@/components/ui"; import { getViewer, safeNext } from "@/lib/auth"; import { SIGNUPS_ENABLED } from "@/lib/signups"; export const metadata: Metadata = { title: "Sign in" }; export default async function LoginPage({ searchParams }: PageProps<"/login">) { const params = await searchParams; const next = safeNext(params.next); if (await getViewer()) redirect(next); return (

Welcome back

Sign in to continue to {BRAND.name}

{params.expired && (
Your sign-in timed out. Enter your password again.
)} {SIGNUPS_ENABLED && (

New to {BRAND.name}?{" "} }>Create an account

)}
); }