import { NextResponse, type NextRequest } from "next/server"; /** Exposes the pathname to server components (used by the auth guard to avoid redirect loops on /admin/settings). */ export function proxy(req: NextRequest) { const h = new Headers(req.headers); h.set("x-pathname", req.nextUrl.pathname); return NextResponse.next({ request: { headers: h } }); } export const config = { matcher: ["/admin/:path*", "/login"] };