Describe the bug
Observed behavior
- After logging in to DSpace and opening a second browser tab, the user is also logged in there. (expected behavior)
- Logging out in one of the two tabs does not immediately affect the other tab, which still appears logged in. (expected behavior)
- However, when the user performs an action in the second tab (the one that still appears logged in), the application may get stuck in an unexpected and inconsistent state.
Expected behavior
As soon as the server responds with 401 Unauthorized (or a similar error code), the application should:
1. inform the user that a logout has occurred in another tab, and
2. immediately redirect to the login page.
Extend the existing AuthInterceptor so that it catches 401 responses and triggers a consistent logout flow (including redirecting to /login). This will ensure that the application does not remain in an inconsistent intermediate state.
Steps to reproduce:
1. Log in as submitter to DSpace Demo
2. Open a second browser tab → user is also logged in there
3. Log out in one of the two tabs
4. In the other tab, perform an action (e.g., navigate to MyDSpace > Workflow tasks)
Result: the application may remain in an unexpected state as you can see in the screenshot
The same behavior also occurs in the opposite scenario:
- When two browser tabs are open and the user is not logged in,
- then the user logs in successfully in one tab,
- the second tab does not reflect the login state, even if further UI actions are performed there.
- Only after a full page reload in the second tab the application recognize that the user is logged in.
Describe the bug
Observed behavior
Expected behavior
As soon as the server responds with 401 Unauthorized (or a similar error code), the application should:
1. inform the user that a logout has occurred in another tab, and
2. immediately redirect to the login page.
Extend the existing
AuthInterceptorso that it catches 401 responses and triggers a consistent logout flow (including redirecting to/login). This will ensure that the application does not remain in an inconsistent intermediate state.Steps to reproduce:
1. Log in as submitter to DSpace Demo
2. Open a second browser tab → user is also logged in there
3. Log out in one of the two tabs
4. In the other tab, perform an action (e.g., navigate to MyDSpace > Workflow tasks)
Result: the application may remain in an unexpected state as you can see in the screenshot
The same behavior also occurs in the opposite scenario: