Browse Source

Email Validation - new pattern

@ included
mhsanaei 1 tháng trước cách đây
mục cha
commit
3e7c7831bc
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      web/service/inbound.go

+ 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