WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@cdmx-in
Copy link
Contributor

@cdmx-in cdmx-in commented Dec 3, 2025

Pull Request: Add Bulk Session Revocation Functionality for Admins

Details

This PR adds bulk session revocation functionality for Admins.
UserBulkRevokeSessionsForm added that allows administrators to revoke all active sessions for selected users, with a confirmation dialog to prevent accidental revocation.

Changes Made

  • Created new UserBulkRevokeSessionsForm.ts component for handling this bulk session revocation
  • Updated UserListPage.ts to integrate the new bulk action with the user list
  • Added user-friendly confirmation workflow
image image

Files Changed:

  • web/src/admin/users/UserBulkRevokeSessionsForm.ts (+207 lines)
  • web/src/admin/users/UserListPage.ts (+82/-38 lines)

@cdmx-in cdmx-in requested a review from a team as a code owner December 3, 2025 12:51
@netlify
Copy link

netlify bot commented Dec 3, 2025

Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit 7000858
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/69364d7db9b4ea0008cc2da9
😎 Deploy Preview https://deploy-preview-18564--authentik-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Dec 3, 2025

Deploy Preview for authentik-integrations ready!

Name Link
🔨 Latest commit 7000858
🔍 Latest deploy log https://app.netlify.com/projects/authentik-integrations/deploys/69364d7d92eb3c00088fb66a
😎 Deploy Preview https://deploy-preview-18564--authentik-integrations.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Dec 3, 2025

Deploy Preview for authentik-storybook ready!

Name Link
🔨 Latest commit 7000858
🔍 Latest deploy log https://app.netlify.com/projects/authentik-storybook/deploys/69364d7d763ecf000803a74a
😎 Deploy Preview https://deploy-preview-18564--authentik-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@cdmx-in cdmx-in changed the title feat: add bulk session revocation functionality for users feat: add bulk session revocation functionality for admins Dec 3, 2025
@codecov
Copy link

codecov bot commented Dec 3, 2025

Codecov Report

❌ Patch coverage is 83.33333% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.16%. Comparing base (37ca473) to head (7000858).
⚠️ Report is 15 commits behind head on main.

Files with missing lines Patch % Lines
authentik/core/api/authenticated_sessions.py 83.33% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #18564      +/-   ##
==========================================
- Coverage   93.21%   93.16%   -0.05%     
==========================================
  Files         933      933              
  Lines       51255    51270      +15     
==========================================
- Hits        47775    47765      -10     
- Misses       3480     3505      +25     
Flag Coverage Δ
e2e 44.79% <83.33%> (+0.03%) ⬆️
integration 22.75% <0.00%> (-0.06%) ⬇️
unit 91.43% <83.33%> (-0.01%) ⬇️
unit-migrate 91.48% <83.33%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rissson rissson changed the title feat: add bulk session revocation functionality for admins core: add bulk session revocation Dec 3, 2025
cdmx-in and others added 2 commits December 4, 2025 09:34
- Implemented BulkDeleteSessionSerializer for handling bulk session deletions.
- Added bulk_delete action to AuthenticatedSessionViewSet for revoking sessions by user IDs.
- Updated API schema to include new endpoint for bulk session deletion.
- Modified UserBulkRevokeSessionsForm to utilize the new bulk delete API.
@roney492 roney492 requested a review from a team as a code owner December 4, 2025 04:21
cdmx-in and others added 4 commits December 4, 2025 21:26
Co-authored-by: Marc 'risson' Schmitt <[email protected]>
Signed-off-by: CodeMax IT Solutions Pvt. Ltd. <[email protected]>
PassiveSerializer for BulkDeleteSessionSerializer

Co-authored-by: Marc 'risson' Schmitt <[email protected]>
Signed-off-by: CodeMax IT Solutions Pvt. Ltd. <[email protected]>
user_pks  instead of user_ids

Co-authored-by: Marc 'risson' Schmitt <[email protected]>
Signed-off-by: CodeMax IT Solutions Pvt. Ltd. <[email protected]>
@cdmx-in
Copy link
Contributor Author

cdmx-in commented Dec 4, 2025

@rissson, have made the requested changes, please review

Copy link
Member

@rissson rissson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a minor nit, otherwise the backend looks good to me!

@rissson rissson added area:frontend Features or issues related to the browser, TypeScript, Node.js, etc area:backend labels Dec 5, 2025
@rissson rissson self-assigned this Dec 5, 2025
@github-project-automation github-project-automation bot moved this from Todo to In Progress in authentik Core Dec 5, 2025
@rissson rissson moved this from In Progress to Needs review in authentik Core Dec 5, 2025
@rissson rissson removed the status in authentik Core Dec 5, 2025
@rissson rissson moved this to In Progress in authentik Core Dec 5, 2025
@rissson rissson added this to the Release 2026.2 milestone Dec 5, 2025
Co-authored-by: Marc 'risson' Schmitt <[email protected]>
Signed-off-by: CodeMax IT Solutions Pvt. Ltd. <[email protected]>
@cdmx-in
Copy link
Contributor Author

cdmx-in commented Dec 5, 2025

Just a minor nit, otherwise the backend looks good to me!

Done. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:backend area:frontend Features or issues related to the browser, TypeScript, Node.js, etc

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants