fix: isolate proxy session decoding
Local Build and Deploy / deploy (push) Successful in 1m2s

This commit is contained in:
Simo committed 2026-07-12 13:39:25 +02:00
1 parent 47bd05f0d9
commit cdf180ee3f
3 files changed
+25 -2

No files matched your search

+2 -2
View File
@@ -1,12 +1,12 @@
import { NextResponse } from "next/server";
import { auth } from "@/lib/auth";
import { proxyAuth } from "@/lib/proxy-auth";
import { shouldRedirectAdminRequest } from "@/lib/proxy-access";
// Edge proxy (formerly "middleware"): Prisma can't run here, so we only forward
// the request path (so server components / the access guard can read it via
// headers()) and normalize the real client IP. The DB-backed banned/maintenance
// checks happen in src/lib/access-guard.ts (Node runtime) from the root layout.
export const proxy = auth((req) => {
export const proxy = proxyAuth((req) => {
if (shouldRedirectAdminRequest(req.nextUrl.pathname, req.auth?.user ?? null)) {
return NextResponse.redirect(new URL("/login", req.url));
}