import type { Metadata } from "next"; import { redirect } from "next/navigation"; import { getUser } from "@/lib/session"; import { LoginForm } from "./login-form"; export const metadata: Metadata = { title: "Log in" }; export default async function LoginPage({ searchParams }: { searchParams: Promise<{ next?: string; verified?: string; reset?: string }> }) { const sp = await searchParams; const user = await getUser(); if (user) redirect(sp.next && sp.next.startsWith("/") ? sp.next : "/dashboard"); return ; }