Skip to content

Commit

Permalink
fix(user): don't crash when attempting to change a user's password
Browse files Browse the repository at this point in the history
  • Loading branch information
kolaente committed Aug 23, 2023
1 parent 665c046 commit 40037f2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/user/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 40037f2

Please sign in to comment.