Merge pull request #2483 from hackr-sh/fix/first-name-last-name-additional-special-chars

fix: name validation now takes into account additional special chars
This commit is contained in:
Alexander Holliday authored and GitHub committed 2025-06-18 09:55:39 +08:00
commit f45736e318
2 files changed
+4 -4

No files matched your search

+2 -2
View File
@@ -7,7 +7,7 @@ const nameSchema = joi
.string()
.max(50)
.trim()
.pattern(/^[\p{L}\p{M}''\- ]+$/u)
.pattern(/^[\p{L}\p{M}''()\-\. ]+$/u)
.messages({
"string.empty": "auth.common.inputs.firstName.errors.empty",
"string.max": "auth.common.inputs.firstName.errors.length",
@@ -18,7 +18,7 @@ const lastnameSchema = joi
.string()
.max(50)
.trim()
.pattern(/^[\p{L}\p{M}''\- ]+$/u)
.pattern(/^[\p{L}\p{M}''()\-\. ]+$/u)
.messages({
"string.empty": "auth.common.inputs.lastName.errors.empty",
"string.max": "auth.common.inputs.lastName.errors.length",