fix(user): don't crash when attempting to change a user's password
continuous-integration/drone/push Build is passing Details

Resolves vikunja/api#1587
Resolves https://github.com/go-vikunja/api/issues/79
This commit is contained in:
kolaente 2023-08-23 15:56:07 +02:00
parent 665c046717
commit 40037f25f2
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 3 additions and 1 deletions

View File

@ -549,7 +549,9 @@ func UpdateUserPassword(s *xorm.Session, user *User, newPassword string) (err er
theUser.Password = hashed
// Update it
_, err = s.ID(user.ID).Update(theUser)
_, err = s.
Where("id = ?", user.ID).
Update(&User{Password: hashed})
if err != nil {
return err
}