Merged in fix/SW-2358-find-my-booking-logged-in-user (pull request #2572)
fix(SW-2358): Enabled anonymous booking view for logged in user * fix(SW-2358): Enabled anonymous booking view for logged in user * fix(SW-2358): Fixed test case for anonymous booking Approved-by: Matilda Landström
This commit is contained in:
@@ -42,21 +42,19 @@ function accessBooking(
|
||||
user.email.toLowerCase() === guest.email?.toLowerCase()
|
||||
) {
|
||||
return ACCESS_GRANTED
|
||||
} else {
|
||||
return ERROR_FORBIDDEN
|
||||
}
|
||||
}
|
||||
|
||||
const values =
|
||||
cookie && (JSON.parse(cookie) as Partial<AdditionalInfoCookieValue>)
|
||||
if (
|
||||
values &&
|
||||
values.firstName?.toLowerCase() === guest.firstName?.toLowerCase() &&
|
||||
values.email?.toLowerCase() === guest.email?.toLowerCase()
|
||||
) {
|
||||
return ACCESS_GRANTED
|
||||
} else {
|
||||
const values =
|
||||
cookie && (JSON.parse(cookie) as Partial<AdditionalInfoCookieValue>)
|
||||
if (
|
||||
values &&
|
||||
values.firstName?.toLowerCase() === guest.firstName?.toLowerCase() &&
|
||||
values.email?.toLowerCase() === guest.email?.toLowerCase()
|
||||
) {
|
||||
return ACCESS_GRANTED
|
||||
} else {
|
||||
return ERROR_BAD_REQUEST
|
||||
}
|
||||
return ERROR_BAD_REQUEST
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user