This commit is contained in:
NextJS
2026-07-12 17:55:44 +00:00
parent 4ed4a10eae
commit e324a95625
28 changed files with 1087 additions and 114 deletions
+3 -4
View File
@@ -1,5 +1,4 @@
import { cookies } from "next/headers";
import { ADMIN_SESSION_COOKIE } from "@/lib/auth/session";
import { getSessionRole } from "@/lib/auth/require-session";
import {
parseMatchIdParam,
readMatchLogFile,
@@ -9,8 +8,8 @@ export async function GET(
_request: Request,
context: { params: Promise<{ matchId: string }> },
) {
const cookieStore = await cookies();
if (cookieStore.get(ADMIN_SESSION_COOKIE)?.value !== "1") {
const role = await getSessionRole();
if (!role) {
return Response.json({ error: "Unauthorized" }, { status: 401 });
}