Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
cicer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Quique
cicer
Commits
c3a75c95
Commit
c3a75c95
authored
4 years ago
by
Quique
Browse files
Options
Downloads
Patches
Plain Diff
Ask for the old password in order to change it
parent
0e999271
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Password.js
+20
-2
20 additions, 2 deletions
src/Password.js
with
20 additions
and
2 deletions
src/Password.js
+
20
−
2
View file @
c3a75c95
...
...
@@ -8,6 +8,7 @@ class OwnPassword extends React.Component {
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
oldPassword
:
""
,
newPassword
:
""
,
newPassword2
:
""
,
formErrors
:
""
,
...
...
@@ -34,6 +35,8 @@ class OwnPassword extends React.Component {
this
.
setState
(
{
error
:
null
,
passwordChanged
:
null
,
formErrors
:
formErrors
,
isNewPasswordValid
:
isNewPasswordValid
,
isNewPassword2Valid
:
isNewPassword2Valid
,
...
...
@@ -55,6 +58,7 @@ class OwnPassword extends React.Component {
this
.
setState
({
isLoading
:
true
,
error
:
null
});
const
body
=
JSON
.
stringify
({
old_password
:
this
.
state
.
oldPassword
,
password
:
this
.
state
.
newPassword
,
});
fetch
(
"
/api/member/me
"
,
{
...
...
@@ -92,7 +96,7 @@ class OwnPassword extends React.Component {
if
(
this
.
state
.
error
)
{
alert
=
(
<
Alert
variant
=
"
danger
"
>
Se
produjo
un
error
al
intentar
cambiar
la
contraseña
:
{
"
"
}
Se
produjo
un
error
al
intentar
cambiar
la
contraseña
:
{
this
.
state
.
error
}
<
/Alert
>
);
...
...
@@ -102,7 +106,6 @@ class OwnPassword extends React.Component {
alert
=
(
<
Alert
variant
=
"
success
"
>
La
contraseña
se
ha
cambiado
con
éxito
.
<
/Alert
>
);
this
.
state
.
passwordChanged
=
false
;
}
return
(
...
...
@@ -112,6 +115,21 @@ class OwnPassword extends React.Component {
{
alert
}
<
Form
onSubmit
=
{
this
.
handleSubmit
}
>
<
Form
.
Group
as
=
{
Row
}
>
<
Form
.
Label
as
=
"
legend
"
column
sm
=
{
4
}
>
Contraseña
actual
<
/Form.Label
>
<
Col
sm
=
{
8
}
>
<
Form
.
Control
placeholder
=
"
Contraseña actual
"
type
=
"
password
"
onChange
=
{(
e
)
=>
this
.
setState
({
oldPassword
:
e
.
target
.
value
})
}
/
>
<
/Col
>
<
/Form.Group
>
<
Form
.
Group
as
=
{
Row
}
>
<
Form
.
Label
as
=
"
legend
"
column
sm
=
{
4
}
>
Nueva
contraseña
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment