Skip to content

Commit

Permalink
Fix: login rerouting only works on the user's current tab (PR:ansible…
Browse files Browse the repository at this point in the history
…#14399)

Signed-off-by: Sasa Jovicic <sjovicic@anexia-it.com>
  • Loading branch information
Sasa Jovicic authored and Sasa993 committed Feb 19, 2024
1 parent dbb80fb commit 127f225
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion awx/ui/src/contexts/Session.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
});
Expand Down

0 comments on commit 127f225

Please sign in to comment.