fix: exclude /api/ routes from Next.js auth middleware

The middleware was intercepting API proxy requests and redirecting
to /login. API routes should pass through to the Go backend which
handles its own JWT auth.
This commit is contained in:
m
2026-03-25 15:58:42 +01:00
parent f8d97546e9
commit 661135d137

View File

@@ -55,6 +55,6 @@ export async function middleware(request: NextRequest) {
export const config = {
matcher: [
"/((?!_next/static|_next/image|favicon.ico|.*\\.(?:svg|png|jpg|jpeg|gif|webp)$).*)",
"/((?!api/|_next/static|_next/image|favicon.ico|.*\\.(?:svg|png|jpg|jpeg|gif|webp)$).*)",
],
};