1
0
mirror of https://github.com/mattermost/focalboard.git synced 2024-11-30 08:36:54 +02:00

Fixing email validation

This commit is contained in:
Jesús Espino 2021-03-18 13:34:42 +01:00
parent 7e96704090
commit 3290ab48b8
2 changed files with 2 additions and 2 deletions

View File

@ -77,7 +77,7 @@ func (rd *RegisterRequest) IsValid() error {
if strings.TrimSpace(rd.Email) == "" {
return errors.New("email is required")
}
if auth.IsEmailValid(rd.Email) {
if !auth.IsEmailValid(rd.Email) {
return errors.New("invalid email format")
}
if rd.Password == "" {

View File

@ -8,7 +8,7 @@ var (
// IsEmailValid checks if the email provided passes the required structure and length.
func IsEmailValid(e string) bool {
if len(e) < 3 && len(e) > 254 {
if len(e) < 3 || len(e) > 254 {
return false
}
return emailRegex.MatchString(e)