fix: password confirmation step
This commit is contained in:
parent
210acd1b02
commit
6fc33261f9
1 changed files with 5 additions and 6 deletions
|
|
@ -42,18 +42,17 @@ const REGISTER = gql`
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|
||||||
const validationSchema = Yup.object().shape({
|
const validationSchema = Yup.object({
|
||||||
password: Yup.string()
|
password: Yup.string()
|
||||||
.required('A password is required')
|
.required('A password is required')
|
||||||
.test(
|
.test(
|
||||||
'len',
|
'len',
|
||||||
'Your password must contain more than 8 characters',
|
'Your password must contain at least 8 characters',
|
||||||
val => val.length >= 8
|
val => val.length >= 8
|
||||||
),
|
),
|
||||||
confirmPassword: Yup.string().oneOf(
|
confirmPassword: Yup.string()
|
||||||
[Yup.ref('password'), null],
|
.required('Please confirm the password')
|
||||||
'Passwords must match'
|
.oneOf([Yup.ref('password')], 'Passwords must match')
|
||||||
)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const initialValues = {
|
const initialValues = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue