MM-11521/MM-11522 Fix being able to create users with invalid emails through API (#9199)

* MM-11522 Fix being able to create users with invalid emails through API

* Ensure store tests are using valid emails

* Add missing license header

* Remove invalid test case

* Fix TestUpdateOAuthUserAttrs
Этот коммит содержится в:
Harrison Healey
2018-08-01 15:18:14 -04:00
коммит произвёл GitHub
родитель a8cc646eed
Коммит c34b30a6e7
16 изменённых файлов: 275 добавлений и 205 удалений

Просмотреть файл

@@ -132,7 +132,7 @@ func (u *User) IsValid() *AppError {
return InvalidUserError("username", u.Id)
}
if len(u.Email) > USER_EMAIL_MAX_LENGTH || len(u.Email) == 0 {
if len(u.Email) > USER_EMAIL_MAX_LENGTH || len(u.Email) == 0 || !IsValidEmail(u.Email) {
return InvalidUserError("email", u.Id)
}