mirror of
https://github.com/ansible/awx.git
synced 2026-02-27 15:58:45 -03:30
Fix: login rerouting only works on the user's current tab (PR:#14399)
Signed-off-by: Sasa Jovicic <sjovicic@anexia-it.com>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user