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
+2 -1
View File
@@ -1,10 +1,11 @@
import { NextResponse } from "next/server";
import type { NextRequest } from "next/server";
import { parseSessionRole } from "@/lib/auth/roles";
import { ADMIN_SESSION_COOKIE } from "@/lib/auth/session";
import { publicRequestUrl } from "@/lib/request-public-url";
function hasValidSession(request: NextRequest): boolean {
return request.cookies.get(ADMIN_SESSION_COOKIE)?.value === "1";
return parseSessionRole(request.cookies.get(ADMIN_SESSION_COOKIE)?.value) != null;
}
export function proxy(request: NextRequest) {