Unverified Commit 4462354d authored by Jon Meyers's avatar Jon Meyers Committed by GitHub

Fix: Add matcher for middleware (#59651)

### What?
- exclude assets from middleware

### Why?
- avoid refreshing session logic running unnecessarily

### How?
- export matcher config from middleware
Co-authored-by: 's avatarJJ Kasper <jj@jjsweb.site>
parent 7eac1c8e
...@@ -23,3 +23,16 @@ export async function middleware(request: NextRequest) { ...@@ -23,3 +23,16 @@ export async function middleware(request: NextRequest) {
}) })
} }
} }
export const config = {
matcher: [
/*
* Match all request paths except for the ones starting with:
* - _next/static (static files)
* - _next/image (image optimization files)
* - favicon.ico (favicon file)
* Feel free to modify this pattern to include more paths.
*/
'/((?!_next/static|_next/image|favicon.ico).*)',
],
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment