-
Notifications
You must be signed in to change notification settings - Fork 114
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 password strength feedback for empty password #6008
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
2902141
Mark password strings as used
aduth 24b2ddc
Join password strength feedback strings as sentences
aduth ca73309
Generate password strength feedback only if password non-empty
aduth 2ec2d33
Add changelog
aduth 6649e74
Add specs for getFeedback
aduth File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 isn't the first time we've had some missing translations with zxcvbn (#5776 comes to mind) is there a better way we can list these, or maybe a safer fallback we can use than to print the slug?
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.
Yeah, these changes should have been included in #5776. As far as preventative measures, I mentioned at the time that it's a bit hard to test for. There was also a reference to formigarafa/zxcvbn-rb#4 where similar issues had been reported upstream. Since that time, there's been a comment of all strings we should cross-reference to our translations.
Aside from that, some ideas we could consider:
zxcvbn.feedback
keys into the locale string extractionThere 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.
I like both those, including all zxcvbn and also not passing through the key (maybe we add a
default:
option like ruby i18n has, and we call back to something general like "please use a different password")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.
Another idea is to use TypeScript to enforce coverage for all strings, but the DefinitelyTyped types appear to only list out the warnings, and not the suggestions.
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.
I double-checked the list in formigarafa/zxcvbn-rb#4 (comment) and made sure we have all strings listed there. I also added a spec in 6649e74 for the specific behavior being introduced here for an empty password. I was going to add a spec for the joining, though from looking at the source code, it doesn't appear there's a combination that could result in a multi-suggestion result being used, since we defer to a warning if it's present.
The ideas in #6008 (comment) are reasonable improvements, but moving forward I might suggest to propose an upstream improvement to the DefinitelyTyped type definitions to include all possible suggestions, then update our implementation to strongly type the feedback mappings, e.g.: