feat: validate production runtime config

This commit is contained in:
2026-07-19 12:47:42 +08:00
parent bc58981de2
commit 6a10ddb6e5
6 changed files with 30 additions and 0 deletions
+4
View File
@@ -0,0 +1,4 @@
import { NextResponse } from "next/server";
import { requireUser } from "@/lib/auth";
import { checkRuntimeConfig } from "@/lib/config";
export async function GET() { try { const user = await requireUser(); if (user.role !== "admin") return NextResponse.json({ error: "Forbidden" }, { status: 403 }); return NextResponse.json(checkRuntimeConfig()); } catch { return NextResponse.json({ error: "Unauthorized" }, { status: 401 }); } }