diff --git a/src/utility/passwordValidator.js b/src/utility/passwordValidator.js index f676635..70ae914 100644 --- a/src/utility/passwordValidator.js +++ b/src/utility/passwordValidator.js @@ -2,22 +2,6 @@ //Between 8-32 characters, One letter, one lower and uppercase letter, One number import * as yup from "yup"; -const passwordValidation = (password) => { - const theLength = /.{8,32}/; - const numberCase = /[0-9]/; - const lowerCase = /[a-z]/; - const upperCase = /[A-Z]/; - if (!theLength.test(password)) { - return "Password Needs to be between 8 and 32 characters"; - } else if (!numberCase.test(password)) { - return "Password needs to contain one number"; - } else if (!lowerCase.test(password)) { - return "Password needs one lowercase letter"; - } else if (!upperCase.test(password)) { - return "Password needs one uppercase letter"; - } -}; - const validationSchema = yup.object({ email: yup .string("Enter your email") @@ -29,4 +13,4 @@ const validationSchema = yup.object({ .required("Password is required"), }); -export { passwordValidation, validationSchema }; +export { validationSchema };