mirror of https://github.com/zulip/zulip.git
Accept any password with at least 6 characters
(imported from commit c6a7d7772820cee49eaaaa6c726a7f194a96e7f8)
This commit is contained in:
parent
10e823704e
commit
ea3ce9c835
|
@ -19,13 +19,18 @@ function password_quality(password, bar) {
|
||||||
if (typeof zxcvbn === 'undefined')
|
if (typeof zxcvbn === 'undefined')
|
||||||
return undefined;
|
return undefined;
|
||||||
|
|
||||||
var result = zxcvbn(password);
|
// Consider the password acceptable if it's at least 6 characters.
|
||||||
var acceptable = result.crack_time >= 1e5;
|
var acceptable = password.length >= 6;
|
||||||
var quality;
|
|
||||||
|
|
||||||
if (bar !== undefined) {
|
if (bar !== undefined) {
|
||||||
// Compute a quality score in [0,1].
|
// Compute a quality score in [0,1].
|
||||||
quality = Math.min(1, Math.log(1 + result.crack_time) / 22);
|
var result = zxcvbn(password);
|
||||||
|
var quality = Math.min(1, Math.log(1 + result.crack_time) / 22);
|
||||||
|
|
||||||
|
// Even if zxcvbn loves your short password, the bar should be filled
|
||||||
|
// at most 1/3 of the way, because we won't accept it.
|
||||||
|
if (!acceptable)
|
||||||
|
quality = Math.min(quality, 0.33);
|
||||||
|
|
||||||
// Display the password quality score on a progress bar
|
// Display the password quality score on a progress bar
|
||||||
// which bottoms out at 10% so there's always something
|
// which bottoms out at 10% so there's always something
|
||||||
|
|
Loading…
Reference in New Issue