Updated login and registration with email confirmation
This commit is contained in:
1 parent
061bed2b59
commit
167baf9e82
5 files changed
+104
-22
No files matched your search
+13
-5
@@ -1,14 +1,22 @@
|
||||
import { redirect } from "next/navigation";
|
||||
import { createClient } from "@/utils/supabase/server";
|
||||
import LoginForm from "./login-form";
|
||||
|
||||
export default async function LoginPage({
|
||||
searchParams,
|
||||
}: {
|
||||
searchParams: Promise<{ next?: string }>;
|
||||
}) {
|
||||
const { next } = await 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} />
|
||||
<LoginForm next={next} initialError={error} />
|
||||
</main>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user