Commit 31537566 authored by ale's avatar ale

Fail pwchange validation if the new password is the same as the old one

parent 9599a213
Pipeline #1542 passed with stages
in 1 minute and 27 seconds
......@@ -38,6 +38,9 @@ func (r *ChangeUserPasswordRequest) Validate(rctx *RequestContext) error {
if err := rctx.fieldValidators.password(rctx.Context, r.Password); err != nil {
return newValidationError(nil, "password", err.Error())
}
if r.Password == r.CurPassword {
return newValidationError(nil, "password", "The new password can't be the same as the old one")
}
return r.PrivilegedRequestBase.Validate(rctx)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment