diff options
author | Johan Lundberg <lundberg@nordu.net> | 2011-05-27 14:09:49 +0200 |
---|---|---|
committer | Johan Lundberg <lundberg@nordu.net> | 2011-05-27 14:09:49 +0200 |
commit | 1fcfc08280991ac25afcf78723340279ac79594f (patch) | |
tree | 31bab9e4f86831aa4192977a1bfd8137829ac680 /media/js | |
parent | 650d1fce18fc1d3632dc42028d6ecdf131177096 (diff) |
Updated so that password strength follows NORDUnet security guidelines.
Diffstat (limited to 'media/js')
-rw-r--r-- | media/js/password_strength.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/media/js/password_strength.js b/media/js/password_strength.js index e2f30b7..24e1dad 100644 --- a/media/js/password_strength.js +++ b/media/js/password_strength.js @@ -39,10 +39,11 @@ var passwordStrength = new function() var nums = this.countRegexp(val, /\d/g), lowers = this.countRegexp(val, /[a-z]/g), uppers = this.countRegexp(val, /[A-Z]/g), - specials = len - nums - lowers - uppers; + specials = len - nums - lowers - uppers, + others = nums + specials; - // not all types used - if (nums == 0 || lowers == 0 || uppers == 0 || specials == 0) + // upper case, lower case and three nums or specials used + if (lowers == 0 || uppers == 0 || others < 3) { return 0; } @@ -70,7 +71,7 @@ var passwordStrength = new function() case (strength > 0 && strength <= 8): return 2; break; - case (strength > 8 && strength <= 12): + case (strength > 10 && strength <= 12): return 3; break; case (strength > 12 && strength <= 15): @@ -89,7 +90,7 @@ $.fn.password_strength = function(options) { var settings = $.extend({ 'container' : null, - 'minLength' : 8, + 'minLength' : 10, 'texts' : { 1 : 'Too weak', 2 : 'Weak password', |