// 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 will fetch and render profile,
    // and only ask for reauth when user submits sensitive changes.
    return <AccountPanel />;
}
