mirror of
https://github.com/Hackdex-App/hackdex-website.git
synced 2026-08-22 00:24:34 -05:00
Better optimize middleware matcher
This commit is contained in:
@@ -6,6 +6,8 @@ export async function middleware(request: NextRequest) {
|
||||
return await updateSession(request)
|
||||
}
|
||||
|
||||
// All values must be hardcoded in the middleware config,
|
||||
// which is why the project ID is hardcoded for the cookie key.
|
||||
export const config = {
|
||||
matcher: [
|
||||
/*
|
||||
@@ -15,6 +17,19 @@ export const config = {
|
||||
* - favicon.ico (favicon file)
|
||||
* Feel free to modify this pattern to include more paths.
|
||||
*/
|
||||
'/((?!_next/static|_next/image|favicon.ico|.*\\.(?:svg|png|jpg|jpeg|gif|webp)$).*)',
|
||||
{
|
||||
// Production
|
||||
source: '/((?!_next/static|_next/image|favicon.ico|.*\\.(?:svg|png|jpg|jpeg|gif|webp)$).*)',
|
||||
has: [
|
||||
{ type: 'cookie', key: 'sb-scfxbqapigdjfebqwmoj-auth-token' },
|
||||
]
|
||||
},
|
||||
{
|
||||
// Local development
|
||||
source: '/((?!_next/static|_next/image|favicon.ico|.*\\.(?:svg|png|jpg|jpeg|gif|webp)$).*)',
|
||||
has: [
|
||||
{ type: 'cookie', key: 'sb-127-auth-token' },
|
||||
]
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user