feat: Add plus address check to /v1/verify
This commit is contained in:
@@ -7,6 +7,7 @@ export interface EmailVerificationResult {
|
||||
valid: boolean;
|
||||
isDisposable: boolean;
|
||||
isTypo: boolean;
|
||||
isPlusAddressed: boolean;
|
||||
domainExists: boolean;
|
||||
hasMxRecords: boolean;
|
||||
suggestedEmail?: string;
|
||||
@@ -27,6 +28,7 @@ export class EmailVerificationService {
|
||||
valid: true,
|
||||
isDisposable: false,
|
||||
isTypo: false,
|
||||
isPlusAddressed: false,
|
||||
domainExists: false,
|
||||
hasMxRecords: false,
|
||||
reasons: [],
|
||||
@@ -46,6 +48,9 @@ export class EmailVerificationService {
|
||||
// MailChecker.isValid returns false for disposable emails
|
||||
result.isDisposable = disposable.validate(domain);
|
||||
|
||||
// Check for plus addressing
|
||||
result.isPlusAddressed = emailParts[0]!.includes('+');
|
||||
|
||||
// Check for common typos and suggest corrections
|
||||
const typoCheck = run({email});
|
||||
if (typoCheck && typoCheck.address && typoCheck.address !== email) {
|
||||
|
||||
Reference in New Issue
Block a user