diff --git a/packages/backend/src/core/EmailService.ts b/packages/backend/src/core/EmailService.ts index da198d0e42..df6b981b69 100644 --- a/packages/backend/src/core/EmailService.ts +++ b/packages/backend/src/core/EmailService.ts @@ -176,6 +176,16 @@ export class EmailService { }; } + const emailDomain: string = emailAddress.split('@')[1]; + const isBanned = this.utilityService.isBlockedHost(this.meta.bannedEmailDomains, emailDomain); + + if (isBanned) { + return { + available: false, + reason: 'banned', + }; + } + let validated: { valid: boolean, reason?: string | null, @@ -214,16 +224,6 @@ export class EmailService { }; } - const emailDomain: string = emailAddress.split('@')[1]; - const isBanned = this.utilityService.isBlockedHost(this.meta.bannedEmailDomains, emailDomain); - - if (isBanned) { - return { - available: false, - reason: 'banned', - }; - } - return { available: true, reason: null,