Mod: メールドメインブラックリストをバリデーションより先に評価する

This commit is contained in:
鴇峰 朔華 2024-11-24 21:15:21 +09:00
parent eddf6a2319
commit a930cddd1f

View file

@ -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: { let validated: {
valid: boolean, valid: boolean,
reason?: string | null, 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 { return {
available: true, available: true,
reason: null, reason: null,