Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to customise need for special character #11

Open
9SL9 opened this issue Mar 24, 2016 · 1 comment
Open

How to customise need for special character #11

9SL9 opened this issue Mar 24, 2016 · 1 comment

Comments

@9SL9
Copy link

9SL9 commented Mar 24, 2016

I want to be able to remove the test for a special character, how would I do this?

@jaankoppe
Copy link

In your config set
minOptionalTestsToPass: 3

and then validate using strong, not errors.

const owasp = require('owasp-password-strength-test');
owasp.config({
    maxLength: 128,
    minLength: 8,
    minOptionalTestsToPass: 3
});

var passStrength = owasp.test('YourPasswordWithoutSpecial1');

if(passStrength.strong) {
    // Your password is good enough
}else{
    // Show errors
    console.log(passStrength.errors)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants