wip
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import { redirect } from 'next/navigation';
|
||||
import { getAuthService } from '@/lib/auth';
|
||||
import { getDriverRepository } from '@/lib/di-container';
|
||||
import OnboardingWizard from '@/components/onboarding/OnboardingWizard';
|
||||
|
||||
export const dynamic = 'force-dynamic';
|
||||
@@ -13,15 +12,10 @@ export default async function OnboardingPage() {
|
||||
redirect('/auth/iracing?returnTo=/onboarding');
|
||||
}
|
||||
|
||||
// Check if user already has a driver profile
|
||||
const driverRepository = getDriverRepository();
|
||||
const primaryDriverId = session.user.primaryDriverId ?? '';
|
||||
|
||||
|
||||
if (primaryDriverId) {
|
||||
const existingDriver = await driverRepository.findById(primaryDriverId);
|
||||
if (existingDriver) {
|
||||
redirect('/dashboard');
|
||||
}
|
||||
redirect('/dashboard');
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user