feat: add first-run admin setup
This commit is contained in:
1 parent
dd2fc71867
commit
2aaa9335e3
16 files changed
+644
-152
No files matched your search
@@ -0,0 +1,22 @@
|
||||
import { AdminSetup } from '@/components/sections/AdminSetup';
|
||||
import { isAdminSetupComplete } from '@/core/auth/adminUsers';
|
||||
import { redirect } from 'next/navigation';
|
||||
|
||||
export const runtime = 'nodejs';
|
||||
export const dynamic = 'force-dynamic';
|
||||
|
||||
export default async function SetupPage() {
|
||||
let databaseReady = true;
|
||||
try {
|
||||
if (await isAdminSetupComplete()) redirect('/vcon/login');
|
||||
} catch {
|
||||
databaseReady = false;
|
||||
}
|
||||
|
||||
return (
|
||||
<AdminSetup
|
||||
databaseReady={databaseReady}
|
||||
initialEmail={process.env.DATASTACK_ADMIN_EMAIL?.trim().toLowerCase() ?? ''}
|
||||
/>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user