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:
Sasa Jovicic
2024-02-20 12:16:13 +00:00
committed by Dave
parent f78ba282a6
commit 1ceebb275c
+4 -1
View File
@@ -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);
}
});