Merged in fix/SW-3205-mystay-anonymous-booking- (pull request #2584)
fix(SW-3205): Disabled ancillary points and saved cards for anonymous booking * fix(SW-3205): Disabled ancillary points and saved cards for anonymous booking * fix(SW-2903 SW-3205): Updated code to be consistent in all scenarios Approved-by: Anton Gunnarsson Approved-by: Matilda Landström
This commit is contained in:
@@ -11,6 +11,7 @@ import Link from "@/components/TempDesignSystem/Link"
|
||||
import useLang from "@/hooks/useLang"
|
||||
|
||||
import type { ManageBookingProps } from "@/types/components/hotelReservation/bookingConfirmation/actions/manageBooking"
|
||||
import type { AdditionalInfoCookieValue } from "@/components/HotelReservation/FindMyBooking/AdditionalInfoForm"
|
||||
|
||||
export default function ManageBooking({ booking }: ManageBookingProps) {
|
||||
const intl = useIntl()
|
||||
@@ -20,12 +21,12 @@ export default function ManageBooking({ booking }: ManageBookingProps) {
|
||||
const { email, firstName, lastName } = booking.guest
|
||||
useEffect(() => {
|
||||
// Setting the `bv` cookie allows direct access to My stay without prompting for more information.
|
||||
const value = new URLSearchParams({
|
||||
const value: AdditionalInfoCookieValue = {
|
||||
email,
|
||||
firstName,
|
||||
lastName,
|
||||
confirmationNumber,
|
||||
}).toString()
|
||||
}
|
||||
document.cookie = `bv=${JSON.stringify(value)}; Path=/; Max-Age=600; Secure; SameSite=Strict`
|
||||
}, [confirmationNumber, email, firstName, lastName])
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ import Promo from "./Promo"
|
||||
import styles from "./promos.module.css"
|
||||
|
||||
import type { PromosProps } from "@/types/components/hotelReservation/bookingConfirmation/promos"
|
||||
import type { AdditionalInfoCookieValue } from "../../FindMyBooking/AdditionalInfoForm"
|
||||
|
||||
export default function Promos({ booking }: PromosProps) {
|
||||
const intl = useIntl()
|
||||
@@ -19,12 +20,12 @@ export default function Promos({ booking }: PromosProps) {
|
||||
const { email, firstName, lastName } = booking.guest
|
||||
useEffect(() => {
|
||||
// Setting the `bv` cookie allows direct access to My stay without prompting for more information.
|
||||
const value = new URLSearchParams({
|
||||
const value: AdditionalInfoCookieValue = {
|
||||
email,
|
||||
firstName,
|
||||
lastName,
|
||||
confirmationNumber,
|
||||
}).toString()
|
||||
}
|
||||
document.cookie = `bv=${JSON.stringify(value)}; Path=/; Max-Age=600; Secure; SameSite=Strict`
|
||||
}, [confirmationNumber, email, firstName, lastName])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user