From 746d58ceb4f9f405a57bc1fcda0b713446f08304 Mon Sep 17 00:00:00 2001 From: Wenkai Yin Date: Thu, 6 Dec 2018 13:29:30 +0800 Subject: [PATCH] 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 --- src/core/api/user.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/api/user.go b/src/core/api/user.go index a8d178fee..b3ee72541 100644 --- a/src/core/api/user.go +++ b/src/core/api/user.go @@ -304,7 +304,8 @@ func (ua *UserAPI) ChangePassword() { } if changePwdOfOwn { 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 } }