-
Notifications
You must be signed in to change notification settings - Fork 0
/
middleware.ts
29 lines (24 loc) · 968 Bytes
/
middleware.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import { NextMiddleware } from 'next/server'
import { stackMiddleware } from '@/utils/middlewares/stack-middleware'
import { supabaseMiddleware } from '@/utils/middlewares/supabase-middleware'
import { authenticateMiddleware } from '@/utils/middlewares/authenticate-middleware'
import { authorizationMiddleware } from '@/utils/middlewares/authorization-middleware'
type MiddlewareFactory = (middleware: NextMiddleware) => NextMiddleware
const middlewares: MiddlewareFactory[] = [
supabaseMiddleware,
authenticateMiddleware,
authorizationMiddleware,
]
export default stackMiddleware(middlewares)
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).*)',
],
}