Fix add/update salted password.

This commit is contained in:
Yang Luo
2021-05-16 21:04:26 +08:00
parent 18806f07a8
commit 4b9ce5f401
5 changed files with 30 additions and 4 deletions

View File

@ -153,8 +153,9 @@ func (c *ApiController) SetPassword() {
return
}
if oldPassword != targetUser.Password {
c.ResponseError("Old password wrong.")
msg := object.CheckPassword(targetUser, oldPassword)
if msg != "" {
c.ResponseError(msg)
return
}