Skip to content

Commit

Permalink
fix: trim whitespace from email on signin page (#714)
Browse files Browse the repository at this point in the history
* fix: trim whitespace from email

* fix: trim email in setter

Co-authored-by: Mohamed Bassem <me@mbassem.com>

---------

Co-authored-by: Mohamed Bassem <me@mbassem.com>
  • Loading branch information
sweepies and MohamedBassem authored Dec 19, 2024
1 parent 6fba9d1 commit 16f2ce3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion apps/mobile/app/signin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export default function Signin() {
autoCapitalize="none"
value={usernameFormData.email}
onChangeText={(e) =>
setUserNameFormData((s) => ({ ...s, email: e }))
setUserNameFormData((s) => ({ ...s, email: e.trim() }))
}
/>
</View>
Expand Down
4 changes: 2 additions & 2 deletions apps/web/components/signin/CredentialsForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function SignIn() {
onSubmit={form.handleSubmit(async (value) => {
const resp = await signIn("credentials", {
redirect: false,
email: value.email,
email: value.email.trim(),
password: value.password,
});
if (!resp || !resp?.ok) {
Expand Down Expand Up @@ -146,7 +146,7 @@ function SignUp() {
}
const resp = await signIn("credentials", {
redirect: false,
email: value.email,
email: value.email.trim(),
password: value.password,
});
if (!resp || !resp.ok) {
Expand Down

0 comments on commit 16f2ce3

Please sign in to comment.