mirror of
https://github.com/ansible/awx.git
synced 2026-03-27 05:45:02 -02: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]);
|
}, [setSessionTimeout, setSessionCountdown]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
const isRedirectCondition = (location, histLength) =>
|
||||||
|
location.pathname === '/login' && histLength === 2;
|
||||||
|
|
||||||
const unlisten = history.listen((location, action) => {
|
const unlisten = history.listen((location, action) => {
|
||||||
if (action === 'POP') {
|
if (action === 'POP' || isRedirectCondition(location, history.length)) {
|
||||||
setIsRedirectLinkReceived(true);
|
setIsRedirectLinkReceived(true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user