import * as Yup from 'yup';
validationSchema: Yup.object({
password: Yup.string().required('Password is required'),
passwordConfirmation: Yup.string()
.oneOf([Yup.ref('password'), null], 'Passwords must match')
});
password: yup
.string()
.required('Please Enter your password')
.matches(
/^(?=.*[A-Za-z])(?=.*d)(?=.*[@$!%*#?&])[A-Za-zd@$!%*#?&]{8,}$/,
"Must Contain 8 Characters, One Uppercase, One Lowercase, One Number and one special case Character"
),
import * as Yup from 'yup';
validationSchema: Yup.object({
password: Yup.string().required('Password is required'),
passwordConfirmation: Yup.string()
.oneOf([Yup.ref('password'), null], 'Passwords must match')
});
passwordConfirm: Yup.string()
+ .label('Password Confirm')
+ .required()
+ .oneOf([Yup.ref('password')], 'Passwords does not match'),
Yup.object({
password: Yup.string().required('Password is required'),
passwordConfirmation: Yup.string()
.test('passwords-match', 'Passwords must match', function(value){
return this.parent.password === value
})
})