Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
ai3
accountserver
Commits
31537566
Commit
31537566
authored
Nov 14, 2018
by
ale
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
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
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
actions_user.go
actions_user.go
+3
-0
No files found.
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
Markdown
is supported
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