This commit is contained in:
Andrew Rodrigues
2019-03-19 14:01:31 -04:00
parent dd8d4f206a
commit 962b7f73d3
3 changed files with 7 additions and 1 deletions

View File

@@ -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');
}