From ef8c50c66855f6940732ff26da899043b0726e71 Mon Sep 17 00:00:00 2001 From: Rohil Surana Date: Thu, 19 Feb 2026 00:40:46 +0530 Subject: [PATCH 1/4] fix(profile): improve full name validation with clearer error messages --- .../components/organization/user/update.tsx | 28 +++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/web/lib/react/components/organization/user/update.tsx b/web/lib/react/components/organization/user/update.tsx index 0e326240d..eb8936d62 100644 --- a/web/lib/react/components/organization/user/update.tsx +++ b/web/lib/react/components/organization/user/update.tsx @@ -25,8 +25,32 @@ const generalSchema = yup .required('Name is required') .min(2, 'Name must be at least 2 characters') .matches( - /^[a-zA-Z\s'-]+$/, - 'Name can only contain letters, spaces, hyphens, and apostrophes' + /^[a-zA-Z\s.'\-]+$/, + 'Name can only contain letters, spaces, periods, hyphens, and apostrophes' + ) + .matches( + /^[a-zA-Z]/, + 'Name must start with a letter' + ) + .matches( + /^[a-zA-Z][a-zA-Z\s.'\-]*[a-zA-Z]$|^[a-zA-Z]$/, + 'Name must end with a letter' + ) + .matches( + /^(?!.*\s\s).*$/, + 'Name cannot have consecutive spaces' + ) + .matches( + /^(?!.*\s[^a-zA-Z]).*$/, + 'Spaces must be followed by a letter' + ) + .matches( + /^(?!.*-[^a-zA-Z]).*$/, + 'Hyphens must be followed by a letter' + ) + .matches( + /^(?!.*'[^a-zA-Z]).*$/, + 'Apostrophes must be followed by a letter' ), email: yup.string().email().required() }) From d605ee8badf4962a8b2799b7faa7d727867f19f3 Mon Sep 17 00:00:00 2001 From: Rohil Surana Date: Thu, 19 Feb 2026 11:38:32 +0530 Subject: [PATCH 2/4] style: fix prettier formatting --- .../components/organization/user/update.tsx | 20 ++++--------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/web/lib/react/components/organization/user/update.tsx b/web/lib/react/components/organization/user/update.tsx index eb8936d62..d6907ddda 100644 --- a/web/lib/react/components/organization/user/update.tsx +++ b/web/lib/react/components/organization/user/update.tsx @@ -28,26 +28,14 @@ const generalSchema = yup /^[a-zA-Z\s.'\-]+$/, 'Name can only contain letters, spaces, periods, hyphens, and apostrophes' ) - .matches( - /^[a-zA-Z]/, - 'Name must start with a letter' - ) + .matches(/^[a-zA-Z]/, 'Name must start with a letter') .matches( /^[a-zA-Z][a-zA-Z\s.'\-]*[a-zA-Z]$|^[a-zA-Z]$/, 'Name must end with a letter' ) - .matches( - /^(?!.*\s\s).*$/, - 'Name cannot have consecutive spaces' - ) - .matches( - /^(?!.*\s[^a-zA-Z]).*$/, - 'Spaces must be followed by a letter' - ) - .matches( - /^(?!.*-[^a-zA-Z]).*$/, - 'Hyphens must be followed by a letter' - ) + .matches(/^(?!.*\s\s).*$/, 'Name cannot have consecutive spaces') + .matches(/^(?!.*\s[^a-zA-Z]).*$/, 'Spaces must be followed by a letter') + .matches(/^(?!.*-[^a-zA-Z]).*$/, 'Hyphens must be followed by a letter') .matches( /^(?!.*'[^a-zA-Z]).*$/, 'Apostrophes must be followed by a letter' From de13b24eb1bd02ec88e0d56bc067ac9749f7458d Mon Sep 17 00:00:00 2001 From: Rohil Surana Date: Thu, 19 Feb 2026 11:45:38 +0530 Subject: [PATCH 3/4] feat: add Unicode support for international names --- .../react/components/organization/user/update.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/web/lib/react/components/organization/user/update.tsx b/web/lib/react/components/organization/user/update.tsx index d6907ddda..b7d80e77c 100644 --- a/web/lib/react/components/organization/user/update.tsx +++ b/web/lib/react/components/organization/user/update.tsx @@ -25,19 +25,19 @@ const generalSchema = yup .required('Name is required') .min(2, 'Name must be at least 2 characters') .matches( - /^[a-zA-Z\s.'\-]+$/, + /^[\p{L}\s.'\-]+$/u, 'Name can only contain letters, spaces, periods, hyphens, and apostrophes' ) - .matches(/^[a-zA-Z]/, 'Name must start with a letter') + .matches(/^\p{L}/u, 'Name must start with a letter') .matches( - /^[a-zA-Z][a-zA-Z\s.'\-]*[a-zA-Z]$|^[a-zA-Z]$/, + /^\p{L}[\p{L}\s.'\-]*\p{L}$|^\p{L}$/u, 'Name must end with a letter' ) .matches(/^(?!.*\s\s).*$/, 'Name cannot have consecutive spaces') - .matches(/^(?!.*\s[^a-zA-Z]).*$/, 'Spaces must be followed by a letter') - .matches(/^(?!.*-[^a-zA-Z]).*$/, 'Hyphens must be followed by a letter') + .matches(/^(?!.*\s[^\p{L}]).*$/u, 'Spaces must be followed by a letter') + .matches(/^(?!.*-[^\p{L}]).*$/u, 'Hyphens must be followed by a letter') .matches( - /^(?!.*'[^a-zA-Z]).*$/, + /^(?!.*'[^\p{L}]).*$/u, 'Apostrophes must be followed by a letter' ), email: yup.string().email().required() From c177d8941caf5e9c2aae7c6fef2048046f6efa70 Mon Sep 17 00:00:00 2001 From: Rohil Surana Date: Thu, 19 Feb 2026 12:18:46 +0530 Subject: [PATCH 4/4] fix: remove unnecessary escape characters in regex --- web/lib/react/components/organization/user/update.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/lib/react/components/organization/user/update.tsx b/web/lib/react/components/organization/user/update.tsx index b7d80e77c..e6ac30cd6 100644 --- a/web/lib/react/components/organization/user/update.tsx +++ b/web/lib/react/components/organization/user/update.tsx @@ -25,12 +25,12 @@ const generalSchema = yup .required('Name is required') .min(2, 'Name must be at least 2 characters') .matches( - /^[\p{L}\s.'\-]+$/u, + /^[\p{L}\s.'-]+$/u, 'Name can only contain letters, spaces, periods, hyphens, and apostrophes' ) .matches(/^\p{L}/u, 'Name must start with a letter') .matches( - /^\p{L}[\p{L}\s.'\-]*\p{L}$|^\p{L}$/u, + /^\p{L}[\p{L}\s.'-]*\p{L}$|^\p{L}$/u, 'Name must end with a letter' ) .matches(/^(?!.*\s\s).*$/, 'Name cannot have consecutive spaces')