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

17 lines
572 B
TypeScript
Raw Normal View History

2025-09-27 14:30:16 -04:00
// app/portal/account/page.tsx
2025-09-30 13:02:57 -04:00
import { cookies } from "next/headers";
import { redirect } from "next/navigation";
import AccountPanel from "./AccountPanel";
2025-09-30 00:56:23 -04:00
2025-09-30 13:02:57 -04:00
export const dynamic = "force-dynamic";
2025-09-30 00:56:23 -04:00
2025-09-30 13:02:57 -04:00
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 will fetch and render profile,
// and only ask for reauth when user submits sensitive changes.
return <AccountPanel />;
2025-09-27 14:30:16 -04:00
}