Skip to content
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

Closed
wants to merge 4 commits into from

Conversation

gayathrigs27
Copy link

No description provided.

@profnandaa
Copy link
Member

Clean this up.

@profnandaa profnandaa added the 🧹 needs-update For PRs that need to be updated before landing label Oct 13, 2019
@gayathrigs27
Copy link
Author

Can you provide more details on it

@gayathrigs27
Copy link
Author

did some cleanup and added a commit . Can u review and comment on it?

Copy link
Member

@profnandaa profnandaa left a 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.

Copy link
Member

@profnandaa profnandaa left a 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);
Copy link
Member

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

@profnandaa
Copy link
Member

Closing in favor of newer PR raised #1348

@profnandaa profnandaa closed this Jun 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧹 needs-update For PRs that need to be updated before landing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants