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

Log out user from all devices #5106

Merged
merged 3 commits into from
Sep 20, 2024
Merged

Log out user from all devices #5106

merged 3 commits into from
Sep 20, 2024

Conversation

rgraber
Copy link
Contributor

@rgraber rgraber commented Sep 11, 2024

Checklist

  1. If you've added code that should be tested, add tests
  2. If you've changed APIs, update (or create!) the documentation
  3. Ensure the tests pass
  4. Make sure that your code lints and that you've followed our coding style
  5. Write a title and, if necessary, a description of your work suitable for publishing in our release notes
  6. Mention any related issues in this repository (as #ISSUE) and in other repositories (as kobotoolbox/other#ISSUE)
  7. Open an issue in the docs if there are UI/UX changes

Description

Adds a new endpoint that will log the calling user out of all sessions and devices.

Notes

Adds usersessions app from allauth, which keeps track of sessions by user using UserSession objects created by a middleware class.

Adds a new endpoint that looks for all UserSession objects associated with the calling user and uses the usersessions adapter to delete all the associated sessions.

To test, login in separate browsers (or the same browser with private windows). curl the new /logout-all endpoint. Refresh the page in all browsers and you should be taken to the login page.

Copy link

@rgraber rgraber changed the base branch from main to beta-refactored September 11, 2024 20:20
@rgraber rgraber added API Changes related to API endpoints Back end labels Sep 12, 2024
@rgraber rgraber changed the base branch from beta-refactored to main September 19, 2024 20:23
@rgraber rgraber changed the base branch from main to beta-refactored September 19, 2024 20:23
@rgraber rgraber closed this Sep 19, 2024
@rgraber rgraber reopened this Sep 19, 2024
@rgraber rgraber merged commit bf20690 into beta-refactored Sep 20, 2024
14 of 15 checks passed
@rgraber rgraber deleted the TASK-1044-logout-all branch September 23, 2024 12:11
@noliveleger noliveleger restored the TASK-1044-logout-all branch October 7, 2024 20:05
@noliveleger noliveleger deleted the TASK-1044-logout-all branch October 7, 2024 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Changes related to API endpoints Back end
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants