Skip to content

Commit

Permalink
Merge pull request #1332 from DalgoT4D/1317-email-id-is-not-being-tri…
Browse files Browse the repository at this point in the history
…mmed

Added trim() in login and signup
  • Loading branch information
fatchat authored Nov 26, 2024
2 parents 3b68444 + 9b17e07 commit f811054
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/pages/login/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export const Login = () => {
const {
register,
handleSubmit,
setValue,
formState: { errors },
} = useForm({
defaultValues: {
Expand Down Expand Up @@ -79,6 +80,7 @@ export const Login = () => {
register={register}
name="username"
helperText={errors.username?.message}
onBlur={(e) => setValue('username', e.target.value.trim())}
/>
<Input
error={!!errors.password}
Expand Down
3 changes: 3 additions & 0 deletions src/pages/signup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const SignUp = () => {
register,
handleSubmit,
watch,
setValue,
formState: { errors },
} = useForm({
defaultValues: {
Expand Down Expand Up @@ -88,6 +89,7 @@ export const SignUp = () => {
placeholder="eg. [email protected]"
register={register}
name="username"
onBlur={(e) => setValue('username', e.target.value.trim())}
required
/>

Expand Down Expand Up @@ -166,6 +168,7 @@ export const SignUp = () => {
register={register}
placeholder="Enter code"
name="signupcode"
onBlur={(e) => setValue('signupcode', e.target.value.trim())}
required
/>
<Button
Expand Down

0 comments on commit f811054

Please sign in to comment.