admin: Return an error when the password has not been changed
continuous-integration/drone/push Build is passing Details

This commit is contained in:
nemunaire 2023-04-13 04:00:13 +02:00
parent fc196a5269
commit bd011c2ff9
1 changed files with 3 additions and 0 deletions

View File

@ -168,6 +168,9 @@ func resetUserPasswd(c *gin.Context) {
c.AbortWithStatusJSON(http.StatusInternalServerError, gin.H{"errmsg": err.Error()})
return
}
} else if user.CheckAuth(urp.Password) {
c.AbortWithStatusJSON(http.StatusNotAcceptable, gin.H{"errmsg": "The reset password is identical to the current password"})
return
}
err = user.DefinePassword(urp.Password)