feat: Add bulk session revocation functionality
Is your feature request related to a problem? Please describe. Currently, when managing user sessions, administrators need to revoke each session individually one by one. This becomes tedious and time-consuming when a user has multiple active sessions that need to be terminated, especially in security scenarios where quick bulk action is needed.
Describe the solution you'd like I would like to have a "Revoke All Sessions" option/button that allows administrators to revoke all active sessions for a specific user account with a single action. This should include a confirmation dialog to prevent accidental bulk revocations.
Describe alternatives you've considered
- Continuing with the current one-by-one approach (inefficient)
- Adding a multi-select checkbox system to select multiple sessions manually before revoking
- Implementing session groups or categories for partial bulk operations
Links to relevant documentation or examples N/A
Additional context This feature request came up during team discussion after fixing session revocation issues. The current individual revocation works well, but bulk operations would significantly improve the user experience for administrators managing multiple sessions.
@cursoragent create a first draft for this, we need to update the auth service and also update the sessions table in the frontend to support bulk revokes. Also consider adding a filter by email.
I implemented new API functionality for administrators to bulk delete user sessions and enhanced session listing with email filtering.
- I added a
DELETE /sessionsendpoint intracecat/organization/router.pyfor bulk revocation, acceptinguser_idorsession_ids. - I implemented
delete_sessions_for_useranddelete_sessions_bulkintracecat/organization/service.pyfor database operations. - I defined
SessionsBulkDeleteRequestandSessionsBulkDeleteResponseintracecat/organization/models.py. - I enhanced
GET /sessionsandlist_sessionsintracecat/organization/service.pyto filter byuser_email.
3 tasks completed
- [x] Add backend endpoint to revoke all sessions for a user
- [x] Implement auth service method to bulk revoke sessions
- [x] Wire backend route, validation, and permissions for bulk revoke
- [ ] Update frontend sessions table to support multi-select and bulk revoke
- [ ] Add confirmation dialog for bulk revoke on frontend
- [ ] Add filter by email to sessions table
- [ ] Connect frontend bulk revoke action to new API
- [ ] Display success/error toasts and loading states
Learn more about Cursor Agents