From 4a23e92d042e9a8fa870033dda6bdb11844347f9 Mon Sep 17 00:00:00 2001 From: Abhishek Yadav Date: Mon, 2 Dec 2024 16:49:28 +0530 Subject: [PATCH] fix: fixed user is able to add empty string in first name --- src/lib/utils/validation.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/utils/validation.ts b/src/lib/utils/validation.ts index c8755e8..c233856 100644 --- a/src/lib/utils/validation.ts +++ b/src/lib/utils/validation.ts @@ -25,7 +25,7 @@ export const registrationSchema = yup.object().shape({ .email() .matches(emailRegex, 'Please enter a valid Email ID') .required('Please enter a valid Email ID'), - firstName: yup.string().matches(firstNameRegex, "Your first name cannot have numbers or special characters.").required('Please enter your first name.'), + firstName: yup.string().trim().matches(firstNameRegex, "Your first name cannot have numbers or special characters.").required('Please enter your first name.'), lastName: yup.string().matches(lastNameRegex, "Your last name cannot have numbers or special characters."), password: yup .string()