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

@@ -1,6 +1,5 @@
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
import { auth } from "@/auth"
import { ScandicFriends } from "@/components/Levels"
import LoginButton from "@/components/LoginButton"
import Button from "@/components/TempDesignSystem/Button"
@@ -8,7 +7,7 @@ import Link from "@/components/TempDesignSystem/Link"
import Body from "@/components/TempDesignSystem/Text/Body"
import Title from "@/components/TempDesignSystem/Text/Title"
import { getIntl } from "@/i18n"
import { isValidSession } from "@/utils/session"
import { isLoggedInUser } from "@/utils/isLoggedInUser"
import Contact from "./Contact"
import ReadMore from "./ReadMore"
@@ -20,9 +19,9 @@ import type { JoinLoyaltyContactProps } from "@/types/components/sidebar/joinLoy
export default async function JoinLoyaltyContact({
block,
}: JoinLoyaltyContactProps) {
const [intl, session] = await Promise.all([getIntl(), auth()])
const [intl, isLoggedIn] = await Promise.all([getIntl(), isLoggedInUser()])
if (isValidSession(session)) {
if (isLoggedIn) {
return null
}

View File

@@ -1,14 +1,13 @@
import { Suspense } from "react"
import { auth } from "@/auth"
import MyPagesSidebar from "@/components/MyPages/Sidebar"
import { isValidSession } from "@/utils/session"
import { isLoggedInUser } from "@/utils/isLoggedInUser"
import SidebarNavigationSkeleton from "../MyPages/Sidebar/SidebarNavigationSkeleton"
export default async function MyPagesNavigation() {
const session = await auth()
if (!isValidSession(session)) {
const isLoggedIn = await isLoggedInUser()
if (!isLoggedIn) {
return null
}
return (