From cefe1fe1ba1c9f361a220e83ab534187ac1508e1 Mon Sep 17 00:00:00 2001 From: Jakob Ankarhem Date: Tue, 11 Oct 2022 14:37:47 +0200 Subject: [PATCH] fix(oidc login): handle reset loading state --- src/components/Login/OIDCLoginButton.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/Login/OIDCLoginButton.tsx b/src/components/Login/OIDCLoginButton.tsx index e47dfa183..8cddd67bd 100644 --- a/src/components/Login/OIDCLoginButton.tsx +++ b/src/components/Login/OIDCLoginButton.tsx @@ -21,7 +21,12 @@ function OIDCLoginButton({ revalidate, oidcName }: Props) { const [loading, setLoading] = useState(false); const handleClick = async () => { setLoading(true); - await oidcAuth.preparePopup(); + try { + await oidcAuth.preparePopup(); + } catch (e) { + setLoading(false); + return; + } setLoading(false); };