diff --git a/awx/ui/src/contexts/Session.js b/awx/ui/src/contexts/Session.js index d0a92d7523..26f915e1d5 100644 --- a/awx/ui/src/contexts/Session.js +++ b/awx/ui/src/contexts/Session.js @@ -115,8 +115,11 @@ function SessionProvider({ children }) { }, [setSessionTimeout, setSessionCountdown]); useEffect(() => { + const isRedirectCondition = (location, histLength) => + location.pathname === '/login' && histLength === 2; + const unlisten = history.listen((location, action) => { - if (action === 'POP') { + if (action === 'POP' || isRedirectCondition(location, history.length)) { setIsRedirectLinkReceived(true); } });