1password: yup
2 .string()
3 .required('Please Enter your password')
4 .matches(
5 /^(?=.*[A-Za-z])(?=.*\d)(?=.*[@$!%*#?&])[A-Za-z\d@$!%*#?&]{8,}$/,
6 "Must Contain 8 Characters, One Uppercase, One Lowercase, One Number and one special case Character"
7 ),
8
1import * as Yup from 'yup';
2
3validationSchema: Yup.object({
4 password: Yup.string().required('Password is required'),
5 passwordConfirmation: Yup.string()
6 .oneOf([Yup.ref('password'), null], 'Passwords must match')
7});
8
1import * as Yup from 'yup';
2
3validationSchema: Yup.object({
4 password: Yup.string().required('Password is required'),
5 passwordConfirmation: Yup.string()
6 .oneOf([Yup.ref('password'), null], 'Passwords must match')
7});
1Yup.object({
2 password: Yup.string().required('Password is required'),
3 passwordConfirmation: Yup.string()
4 .test('passwords-match', 'Passwords must match', function(value){
5 return this.parent.password === value
6 })
7})
8
1Yup.object({
2 password: Yup.string()
3 .required("Please Enter your password")
4 .matches(
5 /^(?=.*[A-Za-z])(?=.*\d)(?=.*[@$!%*#?&])[A-Za-z\d@$!%*#?&]{8,}$/,
6 "Must Contain 8 Characters, One Uppercase, One Lowercase, One Number and one special case Character"
7 ),
8 confirmPassword: Yup.string().test(
9 "passwords-match",
10 "Passwords must match",
11 function (value) {
12 return this.parent.password === value;
13 }
14 )
15})