Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jamalex opened this issue Feb 12, 2015 · 2 comments
Assignees

Comments

@jamalex
Copy link
Member

jamalex commented Feb 12, 2015

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.
@jamalex
Copy link
Member Author

jamalex commented Feb 12, 2015

#2939 was an initial (constrained) attempt at this, on the nalanda branch, but isn't general-purpose.

@anuragkanungo anuragkanungo self-assigned this Feb 16, 2015
@anuragkanungo
Copy link
Contributor

Would work on it soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants