Add dynamic footer badge marquee with admin management.

Store badges in Postgres, expose public/admin APIs, render an infinite footer slider, and ship /admin for paste-embed CRUD.
This commit is contained in:
Atakan Doğan Özban
2026-08-01 19:58:24 +02:00
parent 89c49bcd33
commit 6bf2bffc55
21 changed files with 1027 additions and 20 deletions
+15
View File
@@ -0,0 +1,15 @@
import { NextRequest, NextResponse } from "next/server";
export function requireAdmin(req: NextRequest): NextResponse | null {
const adminKey = process.env.ADMIN_API_KEY;
if (!adminKey) {
return NextResponse.json({ error: "Admin API not configured" }, { status: 503 });
}
const auth = req.headers.get("authorization");
if (auth !== `Bearer ${adminKey}`) {
return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
}
return null;
}