From a6d0b73c0d9d56db6ed140832a1981ce09d4a939 Mon Sep 17 00:00:00 2001 From: Daniel Schalla Date: Wed, 13 Feb 2019 22:08:37 +0100 Subject: [PATCH] Keep current eMail verification status when updating the user password (#10284) --- store/sqlstore/user_store.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/store/sqlstore/user_store.go b/store/sqlstore/user_store.go index 7c97cfa16b..e602281728 100644 --- a/store/sqlstore/user_store.go +++ b/store/sqlstore/user_store.go @@ -250,7 +250,7 @@ func (us SqlUserStore) UpdatePassword(userId, hashedPassword string) store.Store return store.Do(func(result *store.StoreResult) { updateAt := model.GetMillis() - if _, err := us.GetMaster().Exec("UPDATE Users SET Password = :Password, LastPasswordUpdate = :LastPasswordUpdate, UpdateAt = :UpdateAt, AuthData = NULL, AuthService = '', EmailVerified = true, FailedAttempts = 0 WHERE Id = :UserId", map[string]interface{}{"Password": hashedPassword, "LastPasswordUpdate": updateAt, "UpdateAt": updateAt, "UserId": userId}); err != nil { + if _, err := us.GetMaster().Exec("UPDATE Users SET Password = :Password, LastPasswordUpdate = :LastPasswordUpdate, UpdateAt = :UpdateAt, AuthData = NULL, AuthService = '', FailedAttempts = 0 WHERE Id = :UserId", map[string]interface{}{"Password": hashedPassword, "LastPasswordUpdate": updateAt, "UpdateAt": updateAt, "UserId": userId}); err != nil { result.Err = model.NewAppError("SqlUserStore.UpdatePassword", "store.sql_user.update_password.app_error", nil, "id="+userId+", "+err.Error(), http.StatusInternalServerError) } else { result.Data = userId