Skip to content

Detect, within single-page apps, if user has been logged out, and require re-login #3040

@jamalex

Description

@jamalex

Context: A lot of interaction with the site now happens without page reloads (within a single-page app portion of the site, e.g. sidebar and content navigation/viewing). We only check logged-in status on first page load.

Expected: If the user gets logged out (via a timeout, or via logging out in a different tab), this should be detected ASAP and the user should be prompted to login.

Observed: User is still shown as logged in, but API requests start returning 403's or otherwise erroring out/doing funny stuff.

Possible solutions:

For detecting logouts:

  • Less preferred: Detect 403's in API responses
  • More preferred: Augment API requests with metadata regarding things like being logged out (in parallel with the tastypie-metadata-level response data, so these fields won't be loaded into the data).

For requiring logins:

  • Less preferred: Redirect entire page to login page (at least setting the ?next param to bring them back after)
  • More preferred: Popup a Backbone.js-driven login modal, which allows inline AJAX-based login without navigating and losing page state.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions