import { headers } from 'next/headers'; import { createRouteGuard } from '@/lib/auth/createRouteGuard'; interface ProfileLayoutProps { children: React.ReactNode; } /** * Profile Layout * * Provides authentication protection for all profile-related routes. * Uses RouteGuard to enforce access control server-side. */ export default async function ProfileLayout({ children }: ProfileLayoutProps) { const headerStore = await headers(); const pathname = headerStore.get('x-pathname') || '/'; const guard = createRouteGuard(); await guard.enforce({ pathname }); return (
{children}
); }