nextjs-subscription-payments icon indicating copy to clipboard operation
nextjs-subscription-payments copied to clipboard

Middleware called on all request, no matcher set

Open mozeryansky opened this issue 2 years ago • 1 comments

Right now the middleware.ts will be called for every request. I believe it's setup as an example for supabase, but I'm unsure if it's either incomplete or just unused.

I think it should at least include the recommended matcher from the nextjs docs:

export const config = {
  matcher: [
    /*
     * Match all request paths except for the ones starting with:
     * - api (API routes)
     * - _next/static (static files)
     * - _next/image (image optimization files)
     * - favicon.ico (favicon file)
     */
    '/((?!api|_next/static|_next/image|favicon.ico).*)',
  ],
}

mozeryansky avatar Jul 28 '23 19:07 mozeryansky

This issue has been resolved and can be closed.

chriscarrollsmith avatar Mar 10 '24 03:03 chriscarrollsmith