Files
buzz-sheet/components/auth/account-page.tsx
T
gunshiz 0022625edb
CI / Verify (push) Successful in 3m14s
CI / Build immutable images and deploy (push) Successful in 4m0s
feat : big update
2026-10-01 18:37:15 +07:00

16 lines
845 B
TypeScript

import { redirect } from "next/navigation";
import { SiteHeader } from "@/components/public/site-header";
import { getCustomerSession } from "@/lib/auth/server";
import { safeAuthReturnPath } from "@/lib/auth/return-path";
import { AccountForm } from "./account-form";
export async function AccountPage({ mode, next }: { mode: "login" | "register"; next: unknown }) {
const nextPath = safeAuthReturnPath(next);
if (await getCustomerSession()) redirect(nextPath);
const siteKey = process.env.TURNSTILE_SITE_KEY ?? "";
if (process.env.NODE_ENV !== "development" && !siteKey) throw new Error("TURNSTILE_SITE_KEY is required");
return <div className="min-h-svh"><SiteHeader /><main className="grid min-h-[calc(100svh-4rem)] place-items-center p-4">
<AccountForm mode={mode} siteKey={siteKey} nextPath={nextPath} />
</main></div>;
}