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

fix: strong password type #702

Merged
merged 1 commit into from
Nov 12, 2024
Merged

fix: strong password type #702

merged 1 commit into from
Nov 12, 2024

Conversation

spaenleh
Copy link
Member

@spaenleh spaenleh commented Nov 12, 2024

In this PR I fix a type issue with the recently refactored isStrongPassword function.

This function as ported from the validator.js package was accepting an options parameter that could contain the returnScore option. If this was present it would return the score of the password. So the signature of the function was number | boolean. I think this does not makes sens with the name of the function is* where we expect it to return boolean exclusively. So I split the functionality in two functions: isStrongPassword and getPasswordScore that have their own purpose.

@spaenleh spaenleh requested review from pyphilia and ReidyT November 12, 2024 15:23
@spaenleh spaenleh self-assigned this Nov 12, 2024
@spaenleh spaenleh added the bug 🪲 Something isn't working label Nov 12, 2024
Copy link
Contributor

@ReidyT ReidyT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really good refactor 🤖! I'm wondering if the getPasswordScore is really useful for us. If it's not the case, maybe we should consider to remove it?

@spaenleh
Copy link
Member Author

Thank you for your review @ReidyT.

I think currently we are not using it, but it could be used where the user chooses a password to give them a visual indication of the strength of their password. So I think we could keep it for now and see later if we can use it. How does it sound ?

@spaenleh spaenleh added this pull request to the merge queue Nov 12, 2024
Merged via the queue into main with commit 04e0759 Nov 12, 2024
3 checks passed
This was referenced Nov 12, 2024
@spaenleh spaenleh deleted the fix-string-password-type branch November 21, 2024 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working v5.2.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants