This commit is contained in:
2026-02-26 11:07:10 +08:00
parent 85edf0d847
commit eb68553baf
9 changed files with 329 additions and 168 deletions
-7
View File
@@ -22,13 +22,6 @@ export async function POST(req: Request) {
}
const initToken = process.env.INIT_SETUP_TOKEN;
const isProduction = process.env.NODE_ENV === "production";
if (isProduction && !initToken) {
return NextResponse.json(
{ error: "Server misconfigured: INIT_SETUP_TOKEN is required in production." },
{ status: 500 }
);
}
if (initToken) {
const providedToken = req.headers.get("x-init-token");
+15
View File
@@ -0,0 +1,15 @@
import { NextResponse } from "next/server";
import { prisma } from "@/lib/prisma";
export async function GET() {
try {
const settings = await prisma.globalSettings.findUnique({
where: { id: "default" },
select: { id: true },
});
return NextResponse.json({ initialized: Boolean(settings) });
} catch {
return NextResponse.json({ initialized: false, error: "Failed to check settings status" }, { status: 500 });
}
}