-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validate strong Password by validate_password.js #1148
Conversation
Clean this up. |
Can you provide more details on it |
did some cleanup and added a commit . Can u review and comment on it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please clean up this PR, so many unrelated changes in the diff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gayathrigs27
Thanks for your contribution! 🎉 Could you please remove any unrelated changes?
I have a few comments below.
export default function validatePassword(str) { | ||
const format = /[ !@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/; | ||
assertString(str); | ||
return (/[a-z]/.test(str)) && (/[A-Z]/.test(str)) && (/[\d]/.test(str)) && format.test(str); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good.
Few suggestions:
- Perhaps we
minLength
parameter? - Can rename this validator to
isStrongPassword
Closing in favor of newer PR raised #1348 |
No description provided.