mirror of
https://github.com/yusufipk/OpenFrame.git
synced 2026-09-11 17:46:06 +00:00
- Add `onboardingCompletedAt` field to User model + migration - Add AUDIO/R2_AUDIO enum values to schema - Gate dashboard behind onboarding check; redirect to /onboarding if not completed - Add /onboarding page + layout with 5-step wizard (welcome, workspace, project, video info, notifications) - Add POST /api/onboarding/complete endpoint to mark onboarding done Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
25 lines
690 B
TypeScript
25 lines
690 B
TypeScript
import { auth } from '@/lib/auth';
|
|
import { db } from '@/lib/db';
|
|
import { redirect } from 'next/navigation';
|
|
import { OnboardingWizard } from './onboarding-wizard';
|
|
|
|
export default async function OnboardingPage() {
|
|
const session = await auth();
|
|
if (!session?.user?.id) {
|
|
redirect('/login');
|
|
}
|
|
|
|
const user = await db.user.findUnique({
|
|
where: { id: session.user.id },
|
|
select: { onboardingCompletedAt: true, name: true, email: true },
|
|
});
|
|
|
|
if (user?.onboardingCompletedAt) {
|
|
redirect('/dashboard');
|
|
}
|
|
|
|
const userName = user?.name || user?.email?.split('@')[0] || 'there';
|
|
|
|
return <OnboardingWizard userName={userName} />;
|
|
}
|