fix(api): reject a mail-less email domain by its own code (#2608)

This commit is contained in:
Hampus authored and Hampus Kraft committed 2026-09-08 22:17:53 +02:00
1 parent 8cc485cf81
commit c577b97f35
12 files changed
+302 -23

No files matched your search

+1 -1
View File
@@ -343,7 +343,7 @@ export class ReportService {
const normalizedEmail = this.normalizeEmail(email);
const hasValidDns = await this.emailDnsValidationService.hasValidDnsRecords(normalizedEmail);
if (!hasValidDns) {
throw InputValidationError.fromCode('email', ValidationErrorCodes.INVALID_EMAIL_ADDRESS);
throw InputValidationError.fromCode('email', ValidationErrorCodes.EMAIL_DOMAIN_CANNOT_RECEIVE_MAIL);
}
const verificationCode = this.generateDsaVerificationCode();
const expiresAt = new Date(Date.now() + ms('10 minutes'));