Files
gridpilot.gg/apps/website/app/profile/layout.tsx
2026-01-03 02:42:47 +01:00

26 lines
677 B
TypeScript

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 (
<div className="min-h-screen bg-deep-graphite">
{children}
</div>
);
}