diff --git a/awx/ui/src/contexts/Session.js b/awx/ui/src/contexts/Session.js index d0a92d752319..3ed211a49e4d 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); } });