feat(WEB-132): add middlewares, support for seamless login and improve lang based routes
This commit is contained in:
15
middlewares/handleAuth.ts
Normal file
15
middlewares/handleAuth.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { NextResponse } from "next/server"
|
||||
|
||||
import { handleAuth } from "@/constants/routes/handleAuth"
|
||||
|
||||
import type { NextMiddleware } from "next/server"
|
||||
|
||||
import type { MiddlewareMatcher } from "@/types/middleware"
|
||||
|
||||
export const middleware: NextMiddleware = () => {
|
||||
return NextResponse.next()
|
||||
}
|
||||
|
||||
export const matcher: MiddlewareMatcher = (request) => {
|
||||
return handleAuth.includes(request.nextUrl.pathname)
|
||||
}
|
||||
Reference in New Issue
Block a user