fix: allow-reschedule-on-prevent-impersonation (#25427)
* fix: allow-reschedule-on-prevent-impersonation * remove selfexplanatory comment
This commit is contained in:
1 parent
2701b4de79
commit
33c3bf3558
2 files changed
+4
-1
No files matched your search
@@ -8,10 +8,12 @@ export const checkIfBookerEmailIsBlocked = async ({
|
|||||||
bookerEmail,
|
bookerEmail,
|
||||||
loggedInUserId,
|
loggedInUserId,
|
||||||
verificationCode,
|
verificationCode,
|
||||||
|
isReschedule = false,
|
||||||
}: {
|
}: {
|
||||||
bookerEmail: string;
|
bookerEmail: string;
|
||||||
loggedInUserId?: number;
|
loggedInUserId?: number;
|
||||||
verificationCode?: string;
|
verificationCode?: string;
|
||||||
|
isReschedule?: boolean;
|
||||||
}) => {
|
}) => {
|
||||||
const baseEmail = extractBaseEmail(bookerEmail);
|
const baseEmail = extractBaseEmail(bookerEmail);
|
||||||
|
|
||||||
@@ -52,7 +54,7 @@ export const checkIfBookerEmailIsBlocked = async ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const blockedByUserSetting = user?.requiresBookerEmailVerification ?? false;
|
const blockedByUserSetting = user?.requiresBookerEmailVerification ?? false;
|
||||||
const shouldBlock = !!blacklistedByEnv || blockedByUserSetting;
|
const shouldBlock = !!blacklistedByEnv || (blockedByUserSetting && !isReschedule);
|
||||||
|
|
||||||
if (!shouldBlock) {
|
if (!shouldBlock) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -542,6 +542,7 @@ async function handler(
|
|||||||
loggedInUserId: userId,
|
loggedInUserId: userId,
|
||||||
bookerEmail,
|
bookerEmail,
|
||||||
verificationCode: reqBody.verificationCode,
|
verificationCode: reqBody.verificationCode,
|
||||||
|
isReschedule: !!rawBookingData.rescheduleUid,
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error instanceof ErrorWithCode) {
|
if (error instanceof ErrorWithCode) {
|
||||||
|
|||||||
Reference in new issue
Block a user