From db145f9eb83d25ff66e7a3d9aa580ae9ef53f23b Mon Sep 17 00:00:00 2001 From: Rainnny7 Date: Fri, 20 Sep 2024 00:14:26 -0400 Subject: [PATCH] fix the auth form --- src/components/auth/auth-form.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/auth/auth-form.tsx b/src/components/auth/auth-form.tsx index dfe9a69..0ab5b28 100644 --- a/src/components/auth/auth-form.tsx +++ b/src/components/auth/auth-form.tsx @@ -128,9 +128,8 @@ const AuthForm = (): ReactElement => { method: "POST", body: { email }, }); - if (error) { - setError(error.message); - } else { + setError(error?.message); + if (!error) { setStage(data?.exists ? "login" : "register"); } } else {