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:
@@ -14,11 +14,13 @@ const logger = createLogger("BookingFlowProviders")
|
||||
|
||||
export function BookingFlowProviders({ children }: { children: ReactNode }) {
|
||||
const user = useBookingFlowUser()
|
||||
const isLinkedUser =
|
||||
!!user.data && user.data.type === "partner-sas" && user.data.isLinked
|
||||
|
||||
return (
|
||||
<BookingFlowContextProvider
|
||||
data={{
|
||||
isLoggedIn: user.state === "loaded" && !!user.data,
|
||||
isLoggedIn: user.state === "loaded" && isLinkedUser,
|
||||
user,
|
||||
}}
|
||||
>
|
||||
@@ -60,6 +62,7 @@ function useBookingFlowUser(): BookingFlowUser {
|
||||
firstName: euroBonusProfile.firstName || null,
|
||||
lastName: euroBonusProfile.lastName || null,
|
||||
email: euroBonusProfile.email,
|
||||
isLinked: euroBonusProfile.linkStatus === "LINKED",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ body.partner-sas {
|
||||
|
||||
--Scandic-Brand-Warm-White: var(--Background-Primary);
|
||||
--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-Interactive-Default: var(--SAS-40);
|
||||
--Text-Interactive-Hover: var(--SAS-40);
|
||||
|
||||
@@ -47,7 +47,9 @@ export async function createAppContext() {
|
||||
},
|
||||
getScandicUser: async () => {
|
||||
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({
|
||||
token: {
|
||||
|
||||
Reference in New Issue
Block a user