feat(isStrongPassword): add @ as valid symbol#1566
feat(isStrongPassword): add @ as valid symbol#1566profnandaa merged 1 commit intovalidatorjs:masterfrom
@ as valid symbol#1566Conversation
Codecov Report
@@ Coverage Diff @@
## master #1566 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 100 100
Lines 1796 1796
=========================================
Hits 1796 1796
Continue to review full report at Codecov.
|
@ as valid symbol
|
Looking forward to seeing this merged in. Spent an hour debugging my password validation to realize the @ symbol wasn't part of the regex lmao |
|
Same, is there any update on this? It's a dead-simple PR, ready to be merged. |
Probably gonna have to ping an owner or something. |
| const lowerCaseRegex = /^[a-z]$/; | ||
| const numberRegex = /^[0-9]$/; | ||
| const symbolRegex = /^[-#!$%^&*()_+|~=`{}\[\]:";'<>?,.\/ ]$/; | ||
| const symbolRegex = /^[-#!$@%^&*()_+|~=`{}\[\]:";'<>?,.\/ ]$/; |
There was a problem hiding this comment.
Should we do /^[\W_ ]$/ instead?
There was a problem hiding this comment.
I think it's better to hardcode specific characters.
There was a problem hiding this comment.
If that's the case then we should include in the documentation that this function is restricted to ASCII characters only and symbols such as º or § will not work, which will be quite a surprise for some locales that have these symbols in their keyboards.
It would work with /^[\W_ ]$/ though.
There was a problem hiding this comment.
Hmm, that's true. I don't know if people use these "weird" characters in their password? Personally I've never seen someone do that but I dunno. Maybe it is better to do that other regex
|
@profnandaa @ezkemboi @tux-tn any update? |
tux-tn
left a comment
There was a problem hiding this comment.
LGTM 🎉
Thank you for your contribution @stingalleman
adds @ as a valid symbol, also fixes #1563
Checklist