Skip to content

Commit

Permalink
V0.1.7 (#27)
Browse files Browse the repository at this point in the history
* Signup,Login,Logout,Commented out keycloak flow

* changed password validation
  • Loading branch information
vishnuvinay89 authored Dec 3, 2024
1 parent 7c851c1 commit 9ea8f4a
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/components/Signupnew.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,11 @@ const SignUp = () => {
}

// Password validation with regex: at least one uppercase letter, one lowercase letter, one number, and one special character
const passwordRegex = /^(?=.*[A-Z])(?=.*[a-z])(?=.*\d)(?=.*[\W_]).*$/;
if (!password) errors.password = "Password is required.";
else if (password.length < 6) {
errors.password = "Password must be at least 6 characters long.";
} else if (!passwordRegex.test(password)) {
errors.password = "Password must contain at least one uppercase letter, one lowercase letter, one number, and one special character.";
else if (password.length < 4) {
errors.password = "Password must be at least 4 characters long.";
}

if (password !== confirmPassword) {
errors.confirmPassword = "Passwords do not match.";
}
Expand Down

0 comments on commit 9ea8f4a

Please sign in to comment.