From 32bfea1cb754eddbac7ce504cbfda316c2cee28d Mon Sep 17 00:00:00 2001 From: Nicholas Summers Date: Wed, 11 Dec 2024 12:09:06 -0500 Subject: [PATCH 1/2] Try calling windowlocation inside timeout and after await --- services/ui-src/src/hooks/authHooks/userProvider.jsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/services/ui-src/src/hooks/authHooks/userProvider.jsx b/services/ui-src/src/hooks/authHooks/userProvider.jsx index 88603f955..d96ef3086 100644 --- a/services/ui-src/src/hooks/authHooks/userProvider.jsx +++ b/services/ui-src/src/hooks/authHooks/userProvider.jsx @@ -35,12 +35,11 @@ export const UserProvider = ({ children }) => { setUser(null); localStorage.removeItem("mdctcarts_session_exp"); await signOut(); - window.location.href = "/admin"; + window.location.href = config.POST_SIGNOUT_REDIRECT; } catch (error) { console.log("error signing out: ", error); // eslint-disable-line no-console } }); - window.location.href = config.POST_SIGNOUT_REDIRECT; }, []); const checkAuthState = useCallback(async () => { From cc92e8d0ee35343e5e4ae6154dbbee4ba81112cc Mon Sep 17 00:00:00 2001 From: Garrett Rabian Date: Wed, 11 Dec 2024 12:52:15 -0500 Subject: [PATCH 2/2] remove redirect --- services/ui-src/src/hooks/authHooks/userProvider.jsx | 1 - 1 file changed, 1 deletion(-) diff --git a/services/ui-src/src/hooks/authHooks/userProvider.jsx b/services/ui-src/src/hooks/authHooks/userProvider.jsx index d96ef3086..f0b5fd32a 100644 --- a/services/ui-src/src/hooks/authHooks/userProvider.jsx +++ b/services/ui-src/src/hooks/authHooks/userProvider.jsx @@ -35,7 +35,6 @@ export const UserProvider = ({ children }) => { setUser(null); localStorage.removeItem("mdctcarts_session_exp"); await signOut(); - window.location.href = config.POST_SIGNOUT_REDIRECT; } catch (error) { console.log("error signing out: ", error); // eslint-disable-line no-console }