makearmy-app/app/portal/account/page.tsx

16 lines
575 B
TypeScript

// app/portal/account/page.tsx
import { cookies } from "next/headers";
import { redirect } from "next/navigation";
import AccountPanel from "./AccountPanel";
export const dynamic = "force-dynamic";
export default async function AccountPage() {
const at = (await cookies()).get("ma_at")?.value;
if (!at) {
redirect(`/auth/sign-in?next=${encodeURIComponent("/portal/account")}`);
}
// No reauth gating here; the panel fetches and renders profile,
// and only asks for reauth when the user submits sensitive changes.
return <AccountPanel />;
}