Skip to content

Log out user before initial render if persisted session has expired

Axel Bocciarelli requested to merge check-expiry into master

This addresses part of item 1. of #372 (closed). On initial page load, if the user has a persisted session in localStorage, make sure it's still valid before rendering the app. If the session has expired, clear the session from the store before rendering the app, by dispatching a LOG_OUT action.

This behaviour makes the expiration modal obsolete: when the app renders, we're now sure that the session has not expired. If it has, the user ends up being redirected to /login.

The rest remains the same:

  • if the user's SSO token is still valid, the user gets logged back in automatically when the login page renders;
  • if the session expires while the user is on the site, the app becomes unusable.
Edited by Axel Bocciarelli

Merge request reports