Answers for "yup validation for confirm password"

3

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"
    ),
Posted by: Guest on January-13-2021
3

yup password validation

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')
});
Posted by: Guest on January-15-2020
3

how to do password confirm in Yup

passwordConfirm: Yup.string()
+               .label('Password Confirm')
+               .required()
+               .oneOf([Yup.ref('password')], 'Passwords does not match'),
Posted by: Guest on August-10-2020
0

Yup password confirm password

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
    })
})
Posted by: Guest on April-18-2021

Code answers related to "yup validation for confirm password"

Browse Popular Code Answers by Language