vercel / nextjs-subscription-payments

Clone, deploy, and fully customize a SaaS subscription application with Next.js.
https://subscription-payments.vercel.app/
MIT License
6.4k stars 1.3k forks source link

Middleware called on all request, no matcher set #227

Closed mozeryansky closed 6 months ago

mozeryansky commented 1 year ago

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).*)',
  ],
}
chriscarrollsmith commented 6 months ago

This issue has been resolved and can be closed.