Logout fails sometimes
We've seen failures with logging out. The symptom has been that after clicking "Sign out" in the dashboard, after some redirects you're still/again logged in. The browser console shows a cancelled request: sometimes the hydra logout request, sometimes the dashboard logout request. This points to a timing issue.
The "Sign out" button has both an onClick which resets the redux state to the initial one, and a href which points to hydra logout -- hydra will subsequently redirect to dashboard logout.
I believe what happens is this:
- First the state reset is initiated. This is an asynchronous javascript call.
- The onClick returns and the browser starts navigating to the hydra logout page, and if it gets the chance after that the dashboard logout page.
- In the meantime, react resets the redux state to the initial one. Because of how the dashboard frontend was written, for this initial state it will render the dashboard frontend login page.
- The frontend login page automatically starts a dashboard login sequence (see #128 (closed)), which initiates a different redirect.
Depending on timing, 4. might return before the hydra and/or dashboard sessions are ended by 2. . If so, you're not actually logged out.