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
+12 -1
View File
@@ -1,12 +1,15 @@
import type { Metadata } from "next";
import Link from "next/link";
import { notFound } from "next/navigation";
import { canReadPage } from "@/lib/auth/permissions";
import { logPageAccess } from "@/lib/auth/log-page-access";
import { requireSession } from "@/lib/auth/require-session";
import { MatchLogColoredBody } from "@/components/match-log-colored-body";
import {
parseMatchIdParam,
readMatchLogFile,
} from "@/lib/match-logs-server";
import { redirect } from "next/navigation";
export async function generateMetadata({
params,
@@ -24,7 +27,13 @@ export default async function MatchLogPage({
}: {
params: Promise<{ matchId: string }>;
}) {
await requireSession();
const account = await requireSession();
if (
!canReadPage(account, "matches") &&
!canReadPage(account, "analysis")
) {
redirect("/");
}
const { matchId: raw } = await params;
const matchId = parseMatchIdParam(raw);
@@ -32,6 +41,8 @@ export default async function MatchLogPage({
notFound();
}
await logPageAccess(account, "match-log", { matchId });
const result = await readMatchLogFile(matchId);
return (