From 16f2ce378b121dcbea31708630def8ff95e90f14 Mon Sep 17 00:00:00 2001 From: Zach Date: Thu, 19 Dec 2024 09:36:07 -0800 Subject: fix: trim whitespace from email on signin page (#714) * fix: trim whitespace from email * fix: trim email in setter Co-authored-by: Mohamed Bassem --------- Co-authored-by: Mohamed Bassem --- apps/mobile/app/signin.tsx | 2 +- apps/web/components/signin/CredentialsForm.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'apps') diff --git a/apps/mobile/app/signin.tsx b/apps/mobile/app/signin.tsx index df0c2e5f..6119f0f8 100644 --- a/apps/mobile/app/signin.tsx +++ b/apps/mobile/app/signin.tsx @@ -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() })) } /> diff --git a/apps/web/components/signin/CredentialsForm.tsx b/apps/web/components/signin/CredentialsForm.tsx index 313dc7c5..6a1bf985 100644 --- a/apps/web/components/signin/CredentialsForm.tsx +++ b/apps/web/components/signin/CredentialsForm.tsx @@ -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) { @@ -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) { -- cgit v1.2.3-70-g09d2