From 1c2f045baa82d15375ae9b49f75226059262ef15 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 9 Oct 2022 22:54:25 +0100 Subject: [PATCH 1/3] bug fix issue #215 --- src/components/SignUp/Form.tsx | 13 +++++++++---- src/pages/confirm-email.tsx | 6 ++++++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/components/SignUp/Form.tsx b/src/components/SignUp/Form.tsx index 127d43f..a68f931 100644 --- a/src/components/SignUp/Form.tsx +++ b/src/components/SignUp/Form.tsx @@ -8,9 +8,11 @@ export function SignUpForm() { const [username, setUsername] = useState(''); const [password, setPassword] = useState(''); const [showPassword, setShowPassword] = useState(false); + const [isLoading, setIsLoading] = useState(false); const router = useRouter(); const handleSignUp = async () => { + setIsLoading(true); const { error } = await supabase.auth.signUp( { email, password }, { @@ -19,8 +21,10 @@ export function SignUpForm() { }, }, ); - if (error) alert(error.message); - else { + if (error) { + setIsLoading(false); + alert(error.message); + } else { router.push('/confirm-email'); } }; @@ -89,10 +93,11 @@ export function SignUpForm() { ); diff --git a/src/pages/confirm-email.tsx b/src/pages/confirm-email.tsx index feaba4b..f937224 100644 --- a/src/pages/confirm-email.tsx +++ b/src/pages/confirm-email.tsx @@ -1,4 +1,5 @@ import Head from 'next/head'; +import Link from 'next/link'; import { MdOutlineMarkEmailRead } from 'react-icons/md'; import type { PageProps } from '../lib/types'; @@ -15,6 +16,11 @@ export default function ConfirmEmail({}: PageProps) {

Thanks for signing up! We've sent you an email to confirm your account.

+ + + Go to Sign in + + From e017722587335773723a63bd25144b9eec9fd553 Mon Sep 17 00:00:00 2001 From: abdelopx Date: Mon, 10 Oct 2022 09:06:15 +0000 Subject: [PATCH 2/3] bug fix issue #215 --- src/pages/confirm-email.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/pages/confirm-email.tsx b/src/pages/confirm-email.tsx index f937224..47f07c1 100644 --- a/src/pages/confirm-email.tsx +++ b/src/pages/confirm-email.tsx @@ -16,10 +16,11 @@ export default function ConfirmEmail({}: PageProps) {

Thanks for signing up! We've sent you an email to confirm your account.

- - - Go to Sign in - + + Go to Sign in From 2bde777c195961c67ba94ac85761004b121cffea Mon Sep 17 00:00:00 2001 From: abdelopx <50838345+abdelopx@users.noreply.github.com> Date: Mon, 10 Oct 2022 10:22:52 +0100 Subject: [PATCH 3/3] Update src/pages/confirm-email.tsx Co-authored-by: Subho <108616679+subhoghoshX@users.noreply.github.com> --- src/pages/confirm-email.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/confirm-email.tsx b/src/pages/confirm-email.tsx index 47f07c1..a03aeb4 100644 --- a/src/pages/confirm-email.tsx +++ b/src/pages/confirm-email.tsx @@ -18,7 +18,7 @@ export default function ConfirmEmail({}: PageProps) {

Go to Sign in