mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
34 lines
1.2 KiB
TypeScript
34 lines
1.2 KiB
TypeScript
import {CardContent, CardHeader} from "@/components/ui/card";
|
|
import {TooltipProvider} from "@/components/ui/tooltip";
|
|
import {GuardForm} from "@/components/wrappers/auth/guard/guard-form";
|
|
import {cookies} from "next/headers";
|
|
import {redirect} from "next/navigation";
|
|
import {CardAuth} from "@/features/layout/card-auth";
|
|
|
|
export default async function GuardPage() {
|
|
|
|
const cookieStore = await cookies();
|
|
const token = cookieStore.get("better-auth.two_factor")?.value || cookieStore.get("__Secure-better-auth.two_factor")?.value;
|
|
|
|
if (!token) {
|
|
redirect("/login");
|
|
}
|
|
|
|
return (
|
|
<TooltipProvider>
|
|
<CardAuth className="w-full">
|
|
<CardHeader>
|
|
<div className="grid gap-2 text-center mb-2">
|
|
<h1 className="text-3xl font-bold">Two-factor verification</h1>
|
|
<p className="text-balance text-muted-foreground">Please enter the verification code generated
|
|
by your authentication app.</p>
|
|
</div>
|
|
</CardHeader>
|
|
<CardContent>
|
|
<GuardForm/>
|
|
</CardContent>
|
|
</CardAuth>
|
|
</TooltipProvider>
|
|
);
|
|
}
|