Skip to content

Commit

Permalink
fix: symbolRegex in isStrongPassword to include '\' (#2278)
Browse files Browse the repository at this point in the history
* Modified symbolRegex in isStrongPassword to include '\'

* Modify test to check validity of strong password with \ character
  • Loading branch information
nandavikas authored Apr 27, 2024
1 parent 2253a77 commit 8a40349
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/isStrongPassword.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import assertString from './util/assertString';
const upperCaseRegex = /^[A-Z]$/;
const lowerCaseRegex = /^[a-z]$/;
const numberRegex = /^[0-9]$/;
const symbolRegex = /^[-#!$@£%^&*()_+|~=`{}\[\]:";'<>?,.\/ ]$/;
const symbolRegex = /^[-#!$@£%^&*()_+|~=`{}\[\]:";'<>?,.\/\\ ]$/;

const defaultOptions = {
minLength: 8,
Expand Down
1 change: 1 addition & 0 deletions test/validators.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13020,6 +13020,7 @@ describe('Validators', () => {
'+&DxJ=X7-4L8jRCD',
'etV*p%Nr6w&H%FeF',
'£3.ndSau_7',
'VaLIDWith\\Symb0l',
],
invalid: [
'',
Expand Down

0 comments on commit 8a40349

Please sign in to comment.