feat(SW-2116): Use refId instead of confirmationNumber
This commit is contained in:
@@ -21,22 +21,20 @@ function accessBooking(
|
||||
) {
|
||||
if (guest.membershipNumber) {
|
||||
if (user) {
|
||||
if (lastName.toLowerCase() === guest.lastName?.toLowerCase()) {
|
||||
if (
|
||||
user.membershipNumber === guest.membershipNumber &&
|
||||
user.lastName.toLowerCase() === lastName.toLowerCase() &&
|
||||
lastName.toLowerCase() === guest.lastName?.toLowerCase()
|
||||
) {
|
||||
return ACCESS_GRANTED
|
||||
}
|
||||
} else {
|
||||
console.warn(
|
||||
"Access to booking not granted due to anonymous user attempting accessing to logged in booking"
|
||||
)
|
||||
return ERROR_UNAUTHORIZED
|
||||
}
|
||||
|
||||
return ERROR_UNAUTHORIZED
|
||||
}
|
||||
|
||||
if (guest.lastName?.toLowerCase() === lastName.toLowerCase()) {
|
||||
if (user) {
|
||||
console.warn(
|
||||
"Access to booking not granted due to logged in user attempting access to anonymous booking"
|
||||
)
|
||||
return ERROR_FORBIDDEN
|
||||
} else {
|
||||
const params = new URLSearchParams(cookie)
|
||||
@@ -47,17 +45,11 @@ function accessBooking(
|
||||
) {
|
||||
return ACCESS_GRANTED
|
||||
} else {
|
||||
console.warn(
|
||||
"Access to booking not granted due to incorrect cookie values"
|
||||
)
|
||||
return ERROR_BAD_REQUEST
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
console.warn(
|
||||
"Access to booking not granted due to anonymous user attempting access with incorrect lastname"
|
||||
)
|
||||
return ERROR_NOT_FOUND
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user