Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ai3
accountserver
Commits
31537566
Commit
31537566
authored
Nov 14, 2018
by
ale
Browse files
Fail pwchange validation if the new password is the same as the old one
parent
9599a213
Changes
1
Show whitespace changes
Inline
Side-by-side
actions_user.go
View file @
31537566
...
...
@@ -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
)
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment