From 9c64318090297a7d62dc463816ab95c2ba13a1af Mon Sep 17 00:00:00 2001 From: John Date: Fri, 4 Apr 2025 10:56:30 -0500 Subject: [PATCH] fix loading state on sign in --- components/Auth/SignIn.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/Auth/SignIn.tsx b/components/Auth/SignIn.tsx index ddf985c26..0e859cf11 100644 --- a/components/Auth/SignIn.tsx +++ b/components/Auth/SignIn.tsx @@ -26,10 +26,12 @@ export default function SignIn (): ReactElement { if (response.status === 'FIELD_ERROR') { response.formFields.forEach(formField => { setError(formField.error) + setDisabled(false) }) } else if (response.status === 'WRONG_CREDENTIALS_ERROR') { setError('Incorrect email or password.') reset({ password: '' }) + setDisabled(false) } else { // sign in successful. The session tokens are automatically handled by // the frontend SDK. @@ -44,8 +46,8 @@ export default function SignIn (): ReactElement { setError('Something went wrong.') reset({ password: '' }) } + setDisabled(false) } - setDisabled(false) } return ( <>