how to validate password using yup code example
Example 1: yup validation password advanced
password: yup
.string()
.required('Please Enter your password')
.matches(
/^(?=.*[A-Za-z])(?=.*\d)(?=.*[@$!%*#?&])[A-Za-z\d@$!%*#?&]{8,}$/,
"Must Contain 8 Characters, One Uppercase, One Lowercase, One Number and one special case Character"
),
Example 2: how to do password confirm in Yup
passwordConfirm: Yup.string()
+ .label('Password Confirm')
+ .required()
+ .oneOf([Yup.ref('password')], 'Passwords does not match'),