feat: add password change validation to ensure new password differs from current password (#4134)

This commit is contained in:
gongzhongqiang
2025-09-01 17:22:06 +08:00
committed by GitHub
parent 3b16406442
commit 8fa681f883
28 changed files with 57 additions and 0 deletions

View File

@@ -551,6 +551,12 @@ func (c *ApiController) SetPassword() {
return
}
// Check if the new password is the same as the current password
if !object.CheckPasswordNotSameAsCurrent(targetUser, newPassword, organization) {
c.ResponseError(c.T("user:The new password must be different from your current password"))
return
}
application, err := object.GetApplicationByUser(targetUser)
if err != nil {
c.ResponseError(err.Error())