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

@ is not considered as A Special Character in "isStrongPassword" function #1563

Closed
Kpal22 opened this issue Dec 29, 2020 · 3 comments · Fixed by #1566
Closed

@ is not considered as A Special Character in "isStrongPassword" function #1563

Kpal22 opened this issue Dec 29, 2020 · 3 comments · Fixed by #1566

Comments

@Kpal22
Copy link

Kpal22 commented Dec 29, 2020

Description
isStrongPassword function is not considering '@' as a Special Character

Example

(() => {
    const validator = require('validator');
    console.log(validator.isStrongPassword('Aa1Bb2Cc3!'));
    console.log(validator.isStrongPassword('Aa1Bb2Cc3@'));
    console.log(validator.isStrongPassword('Aa1Bb2Cc3#'));
})()

Output ---

true 
false 
true
@lgriveras
Copy link

Hi,
The character \ is not being accepted either as a symbol. I found it while testing all symbols I could think of after the @ bug.

@profnandaa
Copy link
Member

Good catches. I guess \ was because of it being an escape for regex...

@thedevelinmycode
Copy link

@Kpal22 Ran into this as well. The regex in the source doesn't have the @ symbol in it. Should be an easy fix.

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