fix: skip checking password when the code is provided (#2425)

Co-authored-by: aidenlu <aiden_lu@wochacha.com>
This commit is contained in:
aiden 2023-10-19 18:25:25 +08:00 committed by GitHub
parent 45db4deb6b
commit 432a5496f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -478,7 +478,7 @@ func (c *ApiController) SetPassword() {
return return
} }
} }
} else { } else if code == "" {
msg := object.CheckPassword(targetUser, oldPassword, c.GetAcceptLanguage()) msg := object.CheckPassword(targetUser, oldPassword, c.GetAcceptLanguage())
if msg != "" { if msg != "" {
c.ResponseError(msg) c.ResponseError(msg)