feat: add stays to account page usage
This commit is contained in:
@@ -3,7 +3,7 @@ import { NextResponse } from "next/server"
|
||||
import { findLang } from "@/constants/languages"
|
||||
import { authRequired } from "@/constants/routes/authRequired"
|
||||
import { login } from "@/constants/routes/handleAuth"
|
||||
import { benefits, myPages, overview } from "@/constants/routes/myPages"
|
||||
import { benefits, myPages, overview, stays } from "@/constants/routes/myPages"
|
||||
|
||||
import { auth } from "@/auth"
|
||||
|
||||
@@ -45,7 +45,12 @@ export const middleware = auth(async (request) => {
|
||||
if (isLoggedIn) {
|
||||
const pathNameWithoutLang = nextUrl.pathname.replace(`/${lang}`, "")
|
||||
// Temp fix until we have a better solution for identifying AccountPage type
|
||||
const accountPagePaths = [myPages[lang], overview[lang], benefits[lang]]
|
||||
const accountPagePaths = [
|
||||
myPages[lang],
|
||||
overview[lang],
|
||||
benefits[lang],
|
||||
stays[lang],
|
||||
]
|
||||
|
||||
if (accountPagePaths.includes(nextUrl.pathname)) {
|
||||
const searchParams = new URLSearchParams(request.nextUrl.searchParams)
|
||||
|
||||
Reference in New Issue
Block a user