Merged in fix/my-stay-webview-2 (pull request #2191)

fix: webview - mystay - check if we have webviewToken

* fix: webview - mystay - check if we have webviewToken

* Cleanup


Approved-by: Joakim Jäderberg
This commit is contained in:
Linus Flood
2025-05-22 08:38:20 +00:00
parent fe1f4b063d
commit 2ec309354e
12 changed files with 46 additions and 47 deletions

View File

@@ -5,10 +5,9 @@ import { overview } from "@/constants/routes/myPages"
import { isSignupPage } from "@/constants/routes/signup"
import { env } from "@/env/server"
import { auth } from "@/auth"
import ContentPage from "@/components/ContentType/StaticPages/ContentPage"
import { getLang } from "@/i18n/serverContext"
import { isValidSession } from "@/utils/session"
import { isLoggedInUser } from "@/utils/isLoggedInUser"
export { generateMetadata } from "@/utils/generateMetadata"
@@ -22,8 +21,9 @@ export default async function ContentPagePage() {
notFound()
}
const session = await auth()
if (isValidSession(session)) {
const isLoggedIn = await isLoggedInUser()
if (isLoggedIn) {
redirect(overview[lang])
}
}

View File

@@ -15,7 +15,6 @@ import {
getSavedPaymentCardsSafely,
} from "@/lib/trpc/memoizedRequests"
import { auth } from "@/auth"
import AdditionalInfoForm from "@/components/HotelReservation/FindMyBooking/AdditionalInfoForm"
import accessBooking, {
ACCESS_GRANTED,
@@ -34,9 +33,9 @@ import Image from "@/components/Image"
import { getIntl } from "@/i18n"
import { setLang } from "@/i18n/serverContext"
import MyStayProvider from "@/providers/MyStay"
import { isLoggedInUser } from "@/utils/isLoggedInUser"
import * as maskValue from "@/utils/maskValue"
import { parseRefId } from "@/utils/refId"
import { isValidSession } from "@/utils/session"
import { getCurrentWebUrl } from "@/utils/url"
import Tracking from "./tracking"
@@ -64,8 +63,7 @@ export default async function MyStay({
return notFound()
}
const session = await auth()
const isLoggedIn = isValidSession(session)
const isLoggedIn = await isLoggedInUser()
const bv = cookies().get("bv")?.value
let bookingConfirmation

View File

@@ -15,7 +15,6 @@ import {
getSavedPaymentCardsSafely,
} from "@/lib/trpc/memoizedRequests"
import { auth } from "@/auth"
import AdditionalInfoForm from "@/components/HotelReservation/FindMyBooking/AdditionalInfoForm"
import accessBooking, {
ACCESS_GRANTED,
@@ -34,9 +33,9 @@ import Image from "@/components/Image"
import { getIntl } from "@/i18n"
import { setLang } from "@/i18n/serverContext"
import MyStayProvider from "@/providers/MyStay"
import { isLoggedInUser } from "@/utils/isLoggedInUser"
import * as maskValue from "@/utils/maskValue"
import { parseRefId } from "@/utils/refId"
import { isValidSession } from "@/utils/session"
import { getCurrentWebUrl } from "@/utils/url"
import Tracking from "./tracking"
@@ -65,8 +64,7 @@ export default async function MyStay({
return notFound()
}
const session = await auth()
const isLoggedIn = isValidSession(session)
const isLoggedIn = await isLoggedInUser()
const bv = cookies().get("bv")?.value
let bookingConfirmation