account system and syslogs

This commit is contained in:
2026-07-26 18:31:43 +00:00
parent 540f6e0af1
commit 6f7af751e1
37 changed files with 2475 additions and 258 deletions
+7 -3
View File
@@ -1,4 +1,5 @@
import { getSessionRole } from "@/lib/auth/require-session";
import { getSessionAccount } from "@/lib/auth/require-session";
import { canReadPage } from "@/lib/auth/permissions";
import {
parseMatchIdParam,
readMatchLogFile,
@@ -8,8 +9,11 @@ export async function GET(
_request: Request,
context: { params: Promise<{ matchId: string }> },
) {
const role = await getSessionRole();
if (!role) {
const account = await getSessionAccount();
if (
!account ||
(!canReadPage(account, "matches") && !canReadPage(account, "analysis"))
) {
return Response.json({ error: "Unauthorized" }, { status: 401 });
}