Skip to content

Commit 7e6c520

Browse files
committed
Fix broken email validation
1 parent b4c4d6d commit 7e6c520

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"@types/pg": "^7.4.11",
6565
"@types/redis": "^2.8.11",
6666
"@types/uuid": "^3.4.4",
67-
"@types/validator": "^9.4.2",
67+
"@types/validator": "^10.11.0",
6868
"axios": "^0.18.0",
6969
"base64url": "^3.0.0",
7070
"fastify": "^2.2.0",
@@ -75,7 +75,7 @@
7575
"pg": "^7.5.0",
7676
"redis": "^2.8.0",
7777
"uuid": "^3.3.2",
78-
"validator": "^10.8.0"
78+
"validator": "^10.11.0"
7979
},
8080
"nyc": {
8181
"include": [

src/validation/drivers/sanitizers/normalizeEmail.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ export const normalizeEmail = (options?: NormalizeEmailOptions) => <I>(
66
input: I
77
): string => {
88
let normalizedEmail = Validator.normalizeEmail(String(input), options)
9-
let isValid = Validator.isEmail(String(normalizedEmail))
9+
let isValid = Validator.isEmail(String(normalizedEmail), {
10+
ignore_max_length: true,
11+
} as any)
1012

1113
if (isValid && typeof normalizedEmail === "string") {
1214
return normalizedEmail

0 commit comments

Comments
 (0)