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,19 @@
|
||||
import { isAdminSetupComplete } from "@/core/auth/adminUsers";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export const runtime = "nodejs";
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export async function GET() {
|
||||
try {
|
||||
return NextResponse.json(
|
||||
{ setupComplete: await isAdminSetupComplete() },
|
||||
{ headers: { "Cache-Control": "no-store" } },
|
||||
);
|
||||
} catch {
|
||||
return NextResponse.json(
|
||||
{ error: "Admin setup status is unavailable." },
|
||||
{ status: 503, headers: { "Cache-Control": "no-store" } },
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user