mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-01 21:30:30 +01:00
fix: #7472
This commit is contained in:
@@ -50,6 +50,7 @@ var scripts = [
|
||||
'public/vendor/xregexp/unicode/unicode-base.js',
|
||||
'public/src/utils.js',
|
||||
'public/src/installer/install.js',
|
||||
'node_modules/zxcvbn/dist/zxcvbn.js',
|
||||
];
|
||||
|
||||
var installing = false;
|
||||
@@ -131,6 +132,7 @@ function welcome(req, res) {
|
||||
success: success,
|
||||
values: req.body,
|
||||
minimumPasswordLength: defaults.minimumPasswordLength,
|
||||
minimumPasswordStrength: defaults.minimumPasswordStrength,
|
||||
installing: installing,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
/* global zxcvbn */
|
||||
|
||||
$('document').ready(function () {
|
||||
setupInputs();
|
||||
@@ -75,6 +76,9 @@ $('document').ready(function () {
|
||||
} else if (field.length < $('[name="admin:password"]').attr('data-minimum-length')) {
|
||||
parent.addClass('error');
|
||||
help.html('Password is too short.');
|
||||
} else if (zxcvbn(field).score < parseInt($('[name="admin:password"]').attr('data-minimum-strength'), 10)) {
|
||||
parent.addClass('error');
|
||||
help.html('Password is too weak.');
|
||||
} else {
|
||||
parent.removeClass('error');
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
<div class="row input-row">
|
||||
<div class="col-sm-7 col-xs-12 input-field">
|
||||
<label for="admin:password">Password</label>
|
||||
<input type="password" class="form-control" name="admin:password" value="<!-- IF admin:password -->{admin:password}<!-- ENDIF admin:password -->" placeholder="Password" data-minimum-length="{minimumPasswordLength}" />
|
||||
<input type="password" class="form-control" name="admin:password" value="<!-- IF admin:password -->{admin:password}<!-- ENDIF admin:password -->" placeholder="Password" data-minimum-strength="{minimumPasswordStrength}" data-minimum-length="{minimumPasswordLength}" />
|
||||
</div>
|
||||
<div class="col-sm-5 help-text" data-help="Use a combination of numbers, symbols, and different cases. You can change the strictness of password creation in the Admin Control Panel. Minimum {minimumPasswordLength} characters."></div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user