Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
Main Next
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
mashplace
frontend
Main Next
Commits
6bca90fa
Commit
6bca90fa
authored
1 year ago
by
audy.pratama
Browse files
Options
Downloads
Patches
Plain Diff
fix: [MP-1501] add validation error when user input wrong password
parent
04cab447
Branches
Branches containing commit
Tags
b0.39.5
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/features/private/profile/settings/components/ContactDetails/components/CheckPasswordStep/CheckPasswordStep.tsx
+14
-5
14 additions, 5 deletions
...etails/components/CheckPasswordStep/CheckPasswordStep.tsx
with
14 additions
and
5 deletions
src/features/private/profile/settings/components/ContactDetails/components/CheckPasswordStep/CheckPasswordStep.tsx
+
14
−
5
View file @
6bca90fa
...
...
@@ -8,9 +8,9 @@ import { Form } from "react-final-form";
import
TextInput
from
"
@/features/auth/ui/molecules/TextInput
"
;
import
ERRORS
from
"
@/features/auth/utils/errors
"
;
import
{
validatePassword
}
from
"
@/features/auth/utils/validation
"
;
import
{
handleContactUpdate
}
from
"
@/features/private/profile/settings/utils/legacyUtils
"
;
import
{
required
}
from
"
@/lib/validations
"
;
import
{
ErrorBox
}
from
"
@/ui
"
;
import
Button
from
"
@/uikit2/atoms/Button
"
;
import
{
Label
}
from
"
@/uikit2/components
"
;
...
...
@@ -30,7 +30,13 @@ export const CheckPasswordStep: FC<CheckPasswordStepProps> = ({
handleContactUpdate
(
values
,
updateEmailMutation
,
onComplete
)
}
>
{
({
handleSubmit
,
submitting
,
pristine
})
=>
(
{
({
handleSubmit
,
submitting
,
pristine
,
hasValidationErrors
,
submitErrors
,
})
=>
(
<
form
onSubmit
=
{
handleSubmit
}
>
<
Label
className
=
{
styles
.
label
}
>
This is a Two-Factor verification process
...
...
@@ -47,12 +53,15 @@ export const CheckPasswordStep: FC<CheckPasswordStepProps> = ({
type
=
"password"
validate
=
{
composeFieldValidators
(
required
(),
maxLength
(
58
,
ERRORS
.
PASSWORD_IS_TOO_LONG
),
(
v
)
=>
validatePassword
(
v
)
maxLength
(
58
,
ERRORS
.
PASSWORD_IS_TOO_LONG
)
)
}
/>
{
submitErrors
&&
<
ErrorBox
>
{
submitErrors
.
verification
}
</
ErrorBox
>
}
<
ActionsPanel
>
<
Button
.
Blue
disabled
=
{
submitting
||
pristine
}
type
=
"submit"
>
<
Button
.
Blue
disabled
=
{
submitting
||
pristine
||
hasValidationErrors
}
type
=
"submit"
>
Next
</
Button
.
Blue
>
</
ActionsPanel
>
...
...
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