Closed guyaparker closed 6 years ago
Hi @guyaparker, can you take a look at #156 and let me know if this fixes the behavior for you?
Closed by #156.
Hi @jsmecham - sorry for delayed response. Yes, that change is the one I did locally when I diagnosed the issue so I know that works.
Thanks!
There is a logic error in the function helpers.calculatePasswordStrength when the password strength is set to 2. Strength 2 should enforce a minimum of 8 characters and 3 char types but validation will fail if the test is against a string that is 8 characters containing 4 char types.
I think the "(password.length === 8 && charTypes === 3)" in the helpers.calculatePasswordStrength function should be "(password.length === 8 && charTypes >= 3)":
if (password.length < 8) { strength = 0; } else if (charTypes < 3) { strength = 1; } else if (password.length === 8 && charTypes === 3) { strength = 2; } else if (password.length >= 9 && charTypes === 3) { strength = 3; } else if (password.length >= 9 && charTypes === 4) { strength = 4; } else { strength = 0; }