Skip to content

Commit

Permalink
Merge pull request #81 from sparrowapp-dev/fix/fixed-first-name-empty…
Browse files Browse the repository at this point in the history
…-bug-2125

fix: fixed user is able to add empty string in first name
  • Loading branch information
itsmdasifraza authored Dec 5, 2024
2 parents 7cc415e + 4a23e92 commit 0e9b0d4
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 0e9b0d4

Please sign in to comment.