Skip to content

Commit

Permalink
Removed unused password validator code
Browse files Browse the repository at this point in the history
  • Loading branch information
samudra-perera committed Apr 1, 2024
1 parent 1fc3524 commit 78bf0c6
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions src/utility/passwordValidator.js
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -29,4 +13,4 @@ const validationSchema = yup.object({
.required("Password is required"),
});

export { passwordValidation, validationSchema };
export { validationSchema };

0 comments on commit 78bf0c6

Please sign in to comment.