Skip to content

Commit

Permalink
Merge #16978 - Fix #16974 - Replace zxcvbn by zxcvbn-ts
Browse files Browse the repository at this point in the history
Pull-request: #16978
Fixes: #16974

Signed-off-by: William Desportes <williamdes@wdes.fr>
  • Loading branch information
williamdes committed Jun 27, 2021
2 parents 6996e8d + 135b116 commit ee6220d
Show file tree
Hide file tree
Showing 11 changed files with 2,159 additions and 70 deletions.
6 changes: 4 additions & 2 deletions js/src/functions.js
Expand Up @@ -6,7 +6,7 @@
/* global Indexes */ // js/indexes.js
/* global firstDayOfCalendar, maxInputVars, mysqlDocTemplate, themeImagePath */ // templates/javascript/variables.twig
/* global sprintf */ // js/vendor/sprintf.js
/* global zxcvbn */ // js/vendor/zxcvbn.js
/* global zxcvbnts */ // js/vendor/zxcvbn-ts.js

/**
* general function, usually for data manipulation pages
Expand Down Expand Up @@ -518,7 +518,9 @@ Functions.checkPasswordStrength = function (value, meterObject, meterObjectLabel
if (username !== null) {
customDict.push(username);
}
var zxcvbnObject = zxcvbn(value, customDict);

zxcvbnts.core.ZxcvbnOptions.setOptions({ dictionary: { userInputs: customDict } });
var zxcvbnObject = zxcvbnts.core.zxcvbn(value);
var strength = zxcvbnObject.score;
strength = parseInt(strength);
meterObject.val(strength);
Expand Down

0 comments on commit ee6220d

Please sign in to comment.