[MM-13839] Check for password when updating the eMail (#10207)

* Check for password when updating the eMail

* Require password for email change

* Enhance unit testing

* Restructure error handling for update email path

* govet
Этот коммит содержится в:
Daniel Schalla
2019-02-02 00:06:49 +01:00
коммит произвёл Carlos Tadeu Panato Junior
родитель 9a3dc21adc
Коммит 85c60f1402
5 изменённых файлов: 72 добавлений и 9 удалений

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

@@ -854,7 +854,7 @@ func (a *App) UpdatePasswordAsUser(userId, currentPassword, newPassword string)
return err
}
if err := a.doubleCheckPassword(user, currentPassword); err != nil {
if err := a.DoubleCheckPassword(user, currentPassword); err != nil {
if err.Id == "api.user.check_user_password.invalid.app_error" {
err = model.NewAppError("updatePassword", "api.user.update_password.incorrect.app_error", nil, "", http.StatusBadRequest)
}