From 0cbd6c0e1b99b007af8f4d67423f110350cf607a Mon Sep 17 00:00:00 2001 From: Nanda Vikas Konduru Date: Tue, 29 Aug 2023 21:12:07 +0200 Subject: [PATCH 1/2] Modified symbolRegex in isStrongPassword to include '\' --- src/lib/isStrongPassword.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/isStrongPassword.js b/src/lib/isStrongPassword.js index 5db901fa3..8fe9223b7 100644 --- a/src/lib/isStrongPassword.js +++ b/src/lib/isStrongPassword.js @@ -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, From 8c06778593832c2ad1f7bbec4620895f41b0fe5f Mon Sep 17 00:00:00 2001 From: Nanda Vikas Konduru Date: Tue, 29 Aug 2023 21:49:31 +0200 Subject: [PATCH 2/2] Modify test to check validity of strong password with \ character --- test/validators.test.js | 1 + 1 file changed, 1 insertion(+) diff --git a/test/validators.test.js b/test/validators.test.js index 6c68cd71a..8cb23a755 100644 --- a/test/validators.test.js +++ b/test/validators.test.js @@ -12892,6 +12892,7 @@ describe('Validators', () => { '+&DxJ=X7-4L8jRCD', 'etV*p%Nr6w&H%FeF', '£3.ndSau_7', + 'VaLIDWith\\Symb0l', ], invalid: [ '',