mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-05 18:20:37 +01:00
Return the error message when changing password with wrong old password (#6466)
Return a meaningful error message when changing password but the a wrong old password is provided to render on UI Signed-off-by: Wenkai Yin <yinw@vmware.com>
This commit is contained in:
parent
eeb6d4a9b9
commit
746d58ceb4
@ -304,7 +304,8 @@ func (ua *UserAPI) ChangePassword() {
|
|||||||
}
|
}
|
||||||
if changePwdOfOwn {
|
if changePwdOfOwn {
|
||||||
if user.Password != utils.Encrypt(req.OldPassword, user.Salt) {
|
if user.Password != utils.Encrypt(req.OldPassword, user.Salt) {
|
||||||
ua.HandleForbidden("incorrect old_password")
|
log.Info("incorrect old_password")
|
||||||
|
ua.RenderError(http.StatusForbidden, "incorrect old_password")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user