-
-
Notifications
You must be signed in to change notification settings - Fork 237
Require a minimum of 14 characters for strong passwords #38084
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,6 +32,11 @@ import "hqwebapp/js/components/search_box"; | |
| import "hqwebapp/js/bootstrap3/validators.ko"; // email address validation | ||
| import "eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min"; | ||
|
|
||
| // Must not be shorter than settings.MINIMUM_PASSWORD_LENGTH, or generated | ||
| // passwords will be rejected by the server. Kept in sync with | ||
| // STRONG_PASSWORD_LEN in corehq/apps/users/forms.py. | ||
| var STRONG_PASSWORD_LEN = 14; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a way to pass this in from that constant in Alternately, we might use |
||
|
|
||
| // These are used as css classes, so the values of success/warning/error need to be what they are. | ||
| var STATUS = { | ||
| NONE: '', | ||
|
|
@@ -408,7 +413,7 @@ var newUserCreationModel = function (options) { | |
| password += pick(lowercase, 1); | ||
| password += pick(uppercase, 1); | ||
| password += pick(numbers, 1); | ||
| password += pick(all, 6, 10); | ||
| password += pick(all, STRONG_PASSWORD_LEN - password.length); | ||
| return shuffle(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.
Could this just be
STRONG_PASSWORD_LEN = settings.MINIMUM_PASSWORD_LENGTH, and probably skip the comment?