website refactor

This commit is contained in:
2026-01-14 02:02:24 +01:00
parent 8d7c709e0c
commit 4522d41aef
291 changed files with 12763 additions and 9309 deletions

View File

@@ -1,26 +1,22 @@
import type { ReactNode } from 'react';
import { headers } from 'next/headers';
import { redirect } from 'next/navigation';
import ProfileLayoutShell from '@/components/profile/ProfileLayoutShell';
import { createRouteGuard } from '@/lib/auth/createRouteGuard';
interface ProfileLayoutProps {
children: React.ReactNode;
children: 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>
);
}
const result = await guard.enforce({ pathname });
if (result.type === 'redirect') {
redirect(result.to);
}
return <ProfileLayoutShell>{children}</ProfileLayoutShell>;
}