Merged in fix/SW-3526-show-sas-eb-points-rate- (pull request #2973)

fix(SW-3526): Redirect user to login if points rate search and not logged in

Approved-by: Anton Gunnarsson
This commit is contained in:
Hrishikesh Vaipurkar
2025-10-16 09:51:03 +00:00
parent bb3ac1f105
commit 69a1b5f213
2 changed files with 59 additions and 2 deletions

View File

@@ -5,10 +5,13 @@ import { Lang } from "@scandic-hotels/common/constants/language"
import { logger } from "@scandic-hotels/common/logger"
import { findLang } from "@scandic-hotels/common/utils/languages"
import * as bookingFlow from "@/middlewares/bookingFlow"
import * as invalidUrl from "@/middlewares/invalidUrl"
import * as trailingSlash from "@/middlewares/trailingSlash"
import { getDefaultRequestHeaders } from "@/middlewares/utils"
import type { MiddlewareMatcher } from "./middlewares/types"
export const middleware: NextMiddleware = async (request, event) => {
// auth() overrides the request origin, we need the original for internal rewrites
// @see getInternalNextURL()
@@ -31,12 +34,15 @@ export const middleware: NextMiddleware = async (request, event) => {
}
// Note that the order of middlewares is important since that is the order they are matched by.
const middlewares: { middleware: NextMiddleware; matcher: any }[] = [
const middlewares: {
middleware: NextMiddleware
matcher: MiddlewareMatcher
}[] = [
invalidUrl,
trailingSlash,
// authRequired,
// handleAuth,
// bookingFlow,
bookingFlow,
// cmsContent,
]