diff options
Diffstat (limited to 'models/login_source.go')
-rw-r--r-- | models/login_source.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/models/login_source.go b/models/login_source.go index f1941c3e78..d351f12861 100644 --- a/models/login_source.go +++ b/models/login_source.go @@ -771,8 +771,10 @@ func UserSignIn(username, password string) (*User, error) { // Update password hash if server password hash algorithm have changed if user.PasswdHashAlgo != setting.PasswordHashAlgo { - user.HashPassword(password) - if err := UpdateUserCols(user, "passwd", "passwd_hash_algo"); err != nil { + if err = user.SetPassword(password); err != nil { + return nil, err + } + if err = UpdateUserCols(user, "passwd", "passwd_hash_algo", "salt"); err != nil { return nil, err } } |