1
0
Эх сурвалжийг харах

Email Validation - new pattern

@ included
mhsanaei 1 сар өмнө
parent
commit
3e7c7831bc

+ 2 - 2
web/service/inbound.go

@@ -2031,9 +2031,9 @@ func validateEmail(email string) (bool, error) {
 		return false, errors.New("email contains uppercase letters, please convert to lowercase")
 	}
 
-	emailPattern := `^[a-z0-9._-]+$`
+	emailPattern := `^[a-z0-9@._-]+$`
 	if !regexp.MustCompile(emailPattern).MatchString(email) {
-		return false, errors.New("email contains invalid characters, please use only lowercase letters, digits, dots, dashes, and underscores")
+		return false, errors.New("email contains invalid characters, please use only lowercase letters, digits, and @._-")
 	}
 
 	return true, nil