Skip to content

feat: add session management page (list active sessions + revoke)#4841

Open
daniloneto wants to merge 1 commit into
Dokploy:canaryfrom
daniloneto:feat/session-management
Open

feat: add session management page (list active sessions + revoke)#4841
daniloneto wants to merge 1 commit into
Dokploy:canaryfrom
daniloneto:feat/session-management

Conversation

@daniloneto

Copy link
Copy Markdown

Summary

Adds a new Settings → Sessions page that shows all active and expired login sessions with user information, IP address, device, and timestamps. Admins can revoke (force logout) any session except their own.

Changes

Backend (apps/dokploy/server/api/routers/user.ts)

  • listSessionsadminProcedure query that returns sessions joined with user data (email, name), ordered by creation date. Marks the current session with isCurrent.
  • revokeSessionadminProcedure mutation that deletes a session by ID. Guards against self-revocation with a clear error message.

Frontend

  • /dashboard/settings/sessions — new settings page with ShowSessions component
  • Sessions table: user (email + name), IP address, device (parsed from user-agent), created/expires timestamps
  • Active vs expired sections for clarity
  • "Current" badge on the user's own session
  • Revoke button with confirmation dialog (DialogAction)
  • Sidebar link "Sessions" (LogIn icon) placed below Users, gated by member.read

Tests

  • Input validation tests for the revokeSession Zod schema (valid id, missing field, wrong type)

Screenshots

(Screenshots from a running instance can be added — the feature is already deployed and tested on v0.29.11)

Security

  • Only admins/owners can access (gated by adminProcedure)
  • Self-revocation is explicitly blocked
  • Respects existing permission model (member.read for sidebar visibility)

Closes # (no related issue — new feature)

Add a new settings page under Settings > Sessions that shows all active
and expired login sessions with user info, IP address, device, and an
option to revoke (force logout) any session.

Backend:
- listSessions: adminProcedure that returns sessions joined with user
  data, ordered by creation date
- revokeSession: adminProcedure that deletes a session by ID (blocks
  self-revocation)

Frontend:
- New /dashboard/settings/sessions page with ShowSessions component
- Sessions table with user, IP, device, timestamps, and revoke action
- Sidebar link under Users (gated by member.read permission)

Tests:
- Input validation tests for revokeSession schema
@daniloneto
daniloneto requested a review from Siumauricio as a code owner July 17, 2026 13:49
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Jul 17, 2026
AminDhouib added a commit to DevinoSolutions/dokploy-community that referenced this pull request Jul 18, 2026
port: feat: add session management page (list active sessions + revoke) (upstream Dokploy#4841)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant