Skip to content

Commit

Permalink
fix: fixed user is able to add empty string in first name
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhishek9503 committed Dec 2, 2024
1 parent 4b1f4d3 commit 4a23e92
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/utils/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 4a23e92

Please sign in to comment.