Improve black list

Signed-off-by: Michal Čihař <michal@cihar.com>
This commit is contained in:
Michal Čihař 2016-11-10 10:15:12 +01:00
parent 75ce2cb463
commit eb57b8d171

View File

@ -32,10 +32,19 @@ function checkAddUser(the_form)
} // end of the 'checkAddUser()' function
function checkPasswordStrength(value, meter_obj, meter_object_label, username = null) {
customDict = ['phpmyadmin', 'mariadb', 'mysql', 'admin']; //This list may be modified.
if (username != null)
// List of words we don't want to appear in the password
customDict = [
'phpmyadmin',
'mariadb',
'mysql',
'php',
'my',
'admin',
];
if (username != null) {
customDict.push(username)
var zxcvbn_obj = zxcvbn(value,customDict);
}
var zxcvbn_obj = zxcvbn(value, customDict);
var strength = zxcvbn_obj.score;
strength = parseInt(strength);
meter_obj.val(strength);