Merged in feat/user-data (pull request #71)
Feat/user data Approved-by: Christel Westerberg
This commit is contained in:
@@ -5,7 +5,6 @@ import { auth } from "@/auth"
|
||||
import { findLocale } from "@/constants/locales"
|
||||
import { pageNames } from "@/constants/myPages"
|
||||
|
||||
import { apiAuthPrefix } from "@/routes/api"
|
||||
import { protectedRoutes } from "@/routes/protected"
|
||||
|
||||
import type { NextAuthRequest } from "next-auth"
|
||||
@@ -69,11 +68,6 @@ const authedMiddleware = auth(authedMiddlewareFunction)
|
||||
export async function middleware(request: NextRequest) {
|
||||
const { nextUrl } = request
|
||||
|
||||
const isApiRoute = nextUrl.pathname.startsWith(apiAuthPrefix)
|
||||
if (isApiRoute) {
|
||||
return NextResponse.next()
|
||||
}
|
||||
|
||||
const locale = findLocale(nextUrl.pathname)
|
||||
if (!locale) {
|
||||
//return <LocalePicker />
|
||||
@@ -115,5 +109,5 @@ export const config = {
|
||||
* public routes inside middleware.
|
||||
* (https://clerk.com/docs/quickstarts/nextjs?utm_source=sponsorship&utm_medium=youtube&utm_campaign=code-with-antonio&utm_content=12-31-2023#add-authentication-to-your-app)
|
||||
*/
|
||||
matcher: ["/((?!.+\\.[\\w]+$|_next|en/test).*)", "/", "/(api)(.*)"],
|
||||
matcher: ["/((?!.+\\.[\\w]+$|_next|en/test|api|trpc).*)"],
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user