23 lines
643 B
TypeScript
23 lines
643 B
TypeScript
import { redirect } from "next/navigation";
|
|
import { createClient } from "@/utils/supabase/server";
|
|
import LoginForm from "./login-form";
|
|
|
|
export default async function LoginPage({
|
|
searchParams,
|
|
}: Readonly<{
|
|
searchParams: Promise<{ next?: string; error?: string }>;
|
|
}>) {
|
|
const supabase = await createClient();
|
|
const {
|
|
data: { user },
|
|
} = await supabase.auth.getUser();
|
|
if (user) redirect("/profile");
|
|
|
|
const { next, error } = await searchParams;
|
|
return (
|
|
<main className="flex min-h-screen items-center justify-center bg-neutral-50 px-6 py-12">
|
|
<LoginForm next={next} initialError={error} />
|
|
</main>
|
|
);
|
|
}
|