feat(auth) : protect admin login with turnstile
This commit is contained in:
@@ -9,11 +9,16 @@ export default async function AdminLoginPage() {
|
||||
await connection();
|
||||
if (await getAdminSession()) redirect("/admin");
|
||||
|
||||
const turnstileSiteKey = process.env.TURNSTILE_SITE_KEY;
|
||||
if (!turnstileSiteKey) {
|
||||
throw new Error("TURNSTILE_SITE_KEY is required for administrator login.");
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="min-h-svh">
|
||||
<SiteHeader />
|
||||
<main className="grid min-h-[calc(100svh-4rem)] place-items-center px-4 py-12">
|
||||
<LoginCard />
|
||||
<LoginCard turnstileSiteKey={turnstileSiteKey} />
|
||||
</main>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user