clean routes

This commit is contained in:
2026-01-03 02:42:47 +01:00
parent 07985fb8f1
commit 2f21dc4595
107 changed files with 7596 additions and 3401 deletions

View File

@@ -1,24 +1,26 @@
'use client';
import { AuthGuard } from '@/lib/gateways/AuthGuard';
import { ReactNode } from 'react';
import { headers } from 'next/headers';
import { createRouteGuard } from '@/lib/auth/createRouteGuard';
interface OnboardingLayoutProps {
children: ReactNode;
children: React.ReactNode;
}
/**
* Onboarding Layout
*
*
* Provides authentication protection for the onboarding flow.
* Wraps children with AuthGuard to ensure only authenticated users can access.
* Uses RouteGuard to enforce access control server-side.
*/
export default function OnboardingLayout({ children }: OnboardingLayoutProps) {
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 (
<AuthGuard redirectPath="/auth/login">
<div className="min-h-screen bg-deep-graphite">
{children}
</div>
</AuthGuard>
<div className="min-h-screen bg-deep-graphite">
{children}
</div>
);
}