From f26319d261136134cf78b84db147332face31649 Mon Sep 17 00:00:00 2001 From: Lance Pioch Date: Sat, 7 Dec 2024 20:43:45 -0500 Subject: [PATCH 1/2] Show login failure message --- resources/scripts/components/auth/LoginContainer.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/scripts/components/auth/LoginContainer.tsx b/resources/scripts/components/auth/LoginContainer.tsx index 01a586e6b8..7bc9a03258 100644 --- a/resources/scripts/components/auth/LoginContainer.tsx +++ b/resources/scripts/components/auth/LoginContainer.tsx @@ -51,7 +51,8 @@ const LoginContainer = ({ history }: RouteComponentProps) => { history.replace('/auth/login/checkpoint', { token: response.confirmationToken }); }) .catch((error) => { - console.error(error); + setSubmitting(false); + addError({ message: 'Invalid login, please try again.' }); setToken(''); turnstile.reset(); From add9b9448bd463ae33081baa0bc333e5f30bcd48 Mon Sep 17 00:00:00 2001 From: Lance Pioch Date: Sat, 7 Dec 2024 21:05:57 -0500 Subject: [PATCH 2/2] Update resources/scripts/components/auth/LoginContainer.tsx Co-authored-by: MartinOscar <40749467+RMartinOscar@users.noreply.github.com> --- resources/scripts/components/auth/LoginContainer.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/resources/scripts/components/auth/LoginContainer.tsx b/resources/scripts/components/auth/LoginContainer.tsx index 7bc9a03258..ce84f0274f 100644 --- a/resources/scripts/components/auth/LoginContainer.tsx +++ b/resources/scripts/components/auth/LoginContainer.tsx @@ -55,7 +55,9 @@ const LoginContainer = ({ history }: RouteComponentProps) => { addError({ message: 'Invalid login, please try again.' }); setToken(''); - turnstile.reset(); + if (turnstile) { + turnstile.reset(); + } setSubmitting(false); clearAndAddHttpError({ error });