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,6 +1,3 @@
import { headers } from 'next/headers';
import { createRouteGuard } from '@/lib/auth/createRouteGuard';
interface OnboardingLayoutProps {
children: React.ReactNode;
}
@@ -8,19 +5,22 @@ interface OnboardingLayoutProps {
/**
* Onboarding Layout
*
* Provides authentication protection for the onboarding flow.
* Uses RouteGuard to enforce access control server-side.
* Provides basic layout structure for onboarding pages.
* Authentication is handled at the layout boundary.
*/
import { headers } from 'next/headers';
import { redirect } from 'next/navigation';
import { createRouteGuard } from '@/lib/auth/createRouteGuard';
export default async function OnboardingLayout({ children }: OnboardingLayoutProps) {
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 <>{children}</>;
}