diff --git a/src/auth/hooks/useAuthRedirection.ts b/src/auth/hooks/useAuthRedirection.ts index 6ffbb6e59..a00c49139 100644 --- a/src/auth/hooks/useAuthRedirection.ts +++ b/src/auth/hooks/useAuthRedirection.ts @@ -1,5 +1,4 @@ // @ts-strict-ignore -import { getAppMountUri } from "@dashboard/config"; import { getAppMountUriForRedirect } from "@dashboard/utils/urls"; import { useEffect } from "react"; import urlJoin from "url-join"; @@ -40,17 +39,8 @@ export const useAuthRedirection = () => { }; useEffect(() => { - if (!shouldRedirect) { - return; - } - - if (authenticated || authenticating) { - window.location.href = getAppMountUri(); - return; - } - - if (!authenticated && !authenticating) { - handleAuthentication(); + if (shouldRedirect && !authenticated && !authenticating) { + handleAuthentication() } }, [shouldRedirect, authenticated, authenticating]);