Repository Public
1import type { Metadata } from "next";2import { redirect } from "next/navigation";3import type { ReactNode } from "react";4import { currentUser } from "@/lib/auth";5import { AdminShell } from "@/components/admin/shell";67export const dynamic = "force-dynamic";8export const metadata: Metadata = { title: { default: "Studio", template: "%s · Sheet Studio" }, robots: { index: false, follow: false } };910/** Every studio page sits behind this check; the API re-checks on each request, so this is navigation, not security. */11export default async function StudioLayout({ children }: { children: ReactNode }) {12 const user = await currentUser();13 if (!user) redirect("/admin/login");14 if (user.method === "recovery_code") redirect("/admin/setup");15 return <AdminShell csrfToken={user.csrfToken}>{children}</AdminShell>;16}17