import Link from "next/link"; import { getCurrentUser } from "@/lib/auth"; import LogoutButton from "@/components/LogoutButton"; /** * The /op layout intentionally does NOT force-redirect unauthenticated * visitors. The scan page (/op/scan/[token]) needs to bounce them to * /login/operator?next= so they come back to the same QR card after * signing in; a blanket redirect here would lose that context. Each page * under /op is responsible for its own auth gate (see requireOperator in * lib/auth.ts, or the scan page's custom redirect). */ export default async function OperatorLayout({ children }: { children: React.ReactNode }) { const user = await getCurrentUser(); return (
MRP {user ? ( <> {user.name} ) : ( Sign in )}
{children}
); }