Lifter LMS Password Strength Checker
-
Hi, is it possible to write custom logic or update logic relating to password strength checker? I wrote a custom checker but it gets overridden so I have decided to reach out to persist the logic. As you see in the page there are requirements that needs to be checked before we can say that a password is Strong and is okay. For reference I have attached below the code we wanted to be in the password checking logic. Thanks
/** * Retrieve current strength as a number, a slug, or a translated text string * * @since 3.0.0 * @since 5.0.0 Allow password confirmation to be optional when checking strength. * * @param {String} format Derived return format [int|slug|text] defaults to int. * @return mixed */ get_current_strength: function( format ) { format = format || 'int'; var pass = this.$pass.val(), conf = this.$conf && this.$conf.length ? this.$conf.val() : '', val; var currentValue = pass; var hasUppercase = currentValue.match(/[A-Z]/) ? 1 : 0; var hasLowercase = currentValue.match(/[a-z]/) ? 1 : 0; var hasNumber = currentValue.match(/[0-9]/) ? 1 : 0; var hasSymbols = currentValue.match(/[^A-Za-z 0-9]/g) ? 1 : 0; if (currentValue.length < 8) { val = -1; } else { val = hasUppercase + hasLowercase + hasNumber + hasSymbols; } if (conf) { val = pass !== conf ? 5 : val; } if ( 'slug' === format ) { return this.get_strength_slug( val ); } else if ( 'text' === format ) { return this.get_strength_text( val ); } else { return val; } },The page I need help with: [log in to see the link]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Lifter LMS Password Strength Checker’ is closed to new replies.