feat: validate production runtime config
This commit is contained in:
@@ -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 }); } }
|
||||
Reference in New Issue
Block a user