Commit 31537566 authored by ale's avatar ale
Browse files

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

parent 9599a213
......@@ -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)
Supports Markdown
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