Merged in fix/SW-3550-member-rates-should-only- (pull request #3005)

fix(SW-3550): Treat unlinked User as non-logged user within booking flow

Approved-by: Joakim Jäderberg
This commit is contained in:
Hrishikesh Vaipurkar
2025-10-27 14:34:19 +00:00
parent d259a26b6e
commit 98e67f5eda
7 changed files with 12 additions and 6 deletions

View File

@@ -14,11 +14,13 @@ const logger = createLogger("BookingFlowProviders")
export function BookingFlowProviders({ children }: { children: ReactNode }) { export function BookingFlowProviders({ children }: { children: ReactNode }) {
const user = useBookingFlowUser() const user = useBookingFlowUser()
const isLinkedUser =
!!user.data && user.data.type === "partner-sas" && user.data.isLinked
return ( return (
<BookingFlowContextProvider <BookingFlowContextProvider
data={{ data={{
isLoggedIn: user.state === "loaded" && !!user.data, isLoggedIn: user.state === "loaded" && isLinkedUser,
user, user,
}} }}
> >
@@ -60,6 +62,7 @@ function useBookingFlowUser(): BookingFlowUser {
firstName: euroBonusProfile.firstName || null, firstName: euroBonusProfile.firstName || null,
lastName: euroBonusProfile.lastName || null, lastName: euroBonusProfile.lastName || null,
email: euroBonusProfile.email, email: euroBonusProfile.email,
isLinked: euroBonusProfile.linkStatus === "LINKED",
}, },
} }
} }

View File

@@ -127,7 +127,7 @@ body.partner-sas {
--Scandic-Brand-Warm-White: var(--Background-Primary); --Scandic-Brand-Warm-White: var(--Background-Primary);
--Text-Accent-Primary: var(--SAS-20); --Text-Accent-Primary: var(--SAS-20);
--Text-Accent-Secondary: var(--SAS-40); --Text-Accent-Secondary: var(--SAS-Gray-40);
--Text-Heading: var(--SAS-Gray-20); --Text-Heading: var(--SAS-Gray-20);
--Text-Interactive-Default: var(--SAS-40); --Text-Interactive-Default: var(--SAS-40);
--Text-Interactive-Hover: var(--SAS-40); --Text-Interactive-Hover: var(--SAS-40);

View File

@@ -47,7 +47,9 @@ export async function createAppContext() {
}, },
getScandicUser: async () => { getScandicUser: async () => {
const session = await getSession() const session = await getSession()
if (!session) return null
// The getSession will either return empty object or session object, hence we need to validate if the object is empty or not
if (!session?.access_token) return null
return await getVerifiedUser({ return await getVerifiedUser({
token: { token: {

View File

@@ -12,6 +12,7 @@ export type BookingFlowUser =
| (BaseUser & { | (BaseUser & {
type: "partner-sas" type: "partner-sas"
partnerLoyaltyNumber: `EB${string}` partnerLoyaltyNumber: `EB${string}`
isLinked: boolean
}) })
| (BaseUser & { | (BaseUser & {
type: "scandic" type: "scandic"

View File

@@ -41,7 +41,7 @@
color: var(--Text-Default); color: var(--Text-Default);
&.discounted { &.discounted {
color: var(--Text-Accent-Primary); color: var(--Surface-Brand-Primary-1-OnSurface-Accent);
} }
} }

View File

@@ -15,7 +15,7 @@
color: var(--Text-Default); color: var(--Text-Default);
&.discounted { &.discounted {
color: var(--Text-Accent-Primary); color: var(--Surface-Brand-Primary-1-OnSurface-Accent);
} }
} }

View File

@@ -64,7 +64,7 @@
color: var(--Text-Default); color: var(--Text-Default);
&.discounted { &.discounted {
color: var(--Text-Accent-Primary); color: var(--Surface-Brand-Primary-1-OnSurface-Accent);
} }
} }