feat(settings): add admin settings API routes

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-05-16 20:10:46 +02:00
parent 078dc25b87
commit 9b8afa2605
4 changed files with 49 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
export async function requireAdmin(request: Request) {
// Simple fallback: check x-admin-token header vs ADMIN_TOKEN
const token = request.headers.get('x-admin-token');
if (process.env.ADMIN_TOKEN && token === process.env.ADMIN_TOKEN) return;
throw new Response('Unauthorized', { status: 401 });
}