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:
parent
7e96704090
commit
3290ab48b8
@ -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 == "" {
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user