Merged in feat/user-data (pull request #71)

Feat/user data

Approved-by: Christel Westerberg
This commit is contained in:
Simon.Emanuelsson
2024-03-28 10:59:37 +00:00
committed by Michael Zetterberg
31 changed files with 422 additions and 40 deletions

View File

@@ -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).*)"],
}