From 60278f9759dd1cf3354788ea1e646222bcda5769 Mon Sep 17 00:00:00 2001 From: Rithvik Nishad Date: Tue, 7 Nov 2023 17:32:13 +0530 Subject: [PATCH] fixes #6504 (#6559) --- src/Utils/utils.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Utils/utils.ts b/src/Utils/utils.ts index 34d4070dbe9..61c0b939695 100644 --- a/src/Utils/utils.ts +++ b/src/Utils/utils.ts @@ -114,8 +114,12 @@ export const handleSignOut = (forceReload: boolean) => { const redirectURL = new URLSearchParams(window.location.search).get( "redirect" ); - redirectURL ? navigate(`/?redirect=${redirectURL}`) : navigate("/"); - if (forceReload) window.location.href = "/"; + const url = redirectURL ? `/?redirect=${redirectURL}` : "/"; + if (forceReload) { + window.location.href = url; + } else { + navigate(url); + } }; export const handleRedirection = () => {