account system and syslogs
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
import { getSessionRole } from "@/lib/auth/require-session";
|
||||
import { getSessionAccount } from "@/lib/auth/require-session";
|
||||
import { canReadPage } from "@/lib/auth/permissions";
|
||||
import { parseMatchmakerLogParam } from "@/lib/matchmaker-log-source";
|
||||
import { readMatchmakerLogFile } from "@/lib/matchmaker-logs-server";
|
||||
|
||||
const NO_STORE = { "Cache-Control": "no-store, max-age=0" };
|
||||
|
||||
export async function GET(request: Request) {
|
||||
const role = await getSessionRole();
|
||||
if (!role) {
|
||||
const account = await getSessionAccount();
|
||||
if (!account || !canReadPage(account, "matchmaker")) {
|
||||
return Response.json(
|
||||
{ error: "Unauthorized" },
|
||||
{ status: 401, headers: NO_STORE },
|
||||
|
||||
Reference in New Issue
Block a user