Skip to content

feat: admin sessions overview - #3420

Merged
tada5hi merged 11 commits into
masterfrom
feat/admin-sessions-overview
Aug 10, 2026
Merged

tada5hi merged 11 commits into
masterfrom
feat/admin-sessions-overview

Conversation

@tada5hi

@tada5hi tada5hi commented Aug 9, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Adds a dedicated top-level Sessions surface to the admin console, so an admin can oversee every active session across all subjects (users and clients) instead of only the per-user tab.

  • GET /sessions schema: relations.allowed extended from ['realm'] to ['realm', 'user', 'client']. Both new includes are gated per target by the relations read gate (Include-authorization gating via schema relations.validate at decode time (#3286 phase 3, part 4) #3295) on the USER_READ / CLIENT_READ disjunctions; self-service readers get the include silently stripped. The joined client stays covered by the client schema's secret field gate and the universal redactFieldConditions sweep. No other server changes.
  • @authup/client-web-kit: new ASessionTokens collection component (mirror of ASessions over EntityType.SESSION_TOKEN).
  • @authup/i18n: sessionToken entity noun, authMethod/kind/subject/refreshedAt/mfaAt field labels, all common label and token-status copy, authored in en/de/fr/es.
  • Admin console: sidebar entry plus /sessions page group, gated on SESSION_READ:
    • list: subject names with kind icons and permission-guarded links, auth-method badge with MFA indicator, IP / user agent / seen / expires columns, subject-kind filter (all / users / clients), per-row revoke with confirm; the admin's own current session shows a badge instead of the delete button
    • detail (/sessions/:id): general card, guarded subject resolution (falls back to the sub uuid), read-only token inventory via GET /session-tokens?filter[sessionId]=...&include=client with per-application attribution and a derived status (revoked / consumed / expired / active), revoke button guarded on SESSION_DELETE and the current session
  • .agents/ docs updated (session UI surfaces, page-placement examples).

Verification

  • New HTTP spec session-include.spec.ts: admin include=user,realm hydration, client-subject include=client hydration, silent strip for a reader without USER_READ.
  • Full monorepo build, full test suite (18 workspaces) and check:types -w apps/server-core green on the final tree.
  • Real-browser pass against a running stack: login, list rendering, subject-kind filter, detail page with token inventory, revoke flow end to end. This pass surfaced two SSR-only bugs (empty-string SelectItem value on the filter; a second useAsyncData after await losing the Nuxt context) which are fixed on the branch.

Notes

  • The tokens table is read-only in v1; per-token revoke is a possible follow-up.
  • Sessions' canonical home is now the top-level page; users/[id]/sessions remains the parent-scoped lens.

Summary by CodeRabbit

  • New Features
    • Added a sessions administration area with filtering, sorting, pagination, and permission-aware details.
    • Added session detail views with metadata, authentication and MFA indicators, and session-token status information.
    • Added support for deleting non-current sessions and logging out sessions from the detail view.
    • Added navigation access and localized labels in English, German, Spanish, and French.
  • Bug Fixes
    • Improved visibility of session subjects while respecting access permissions.

Copilot AI lite review requested due to automatic review settings August 9, 2026 19:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Aug 9, 2026 •

Copy link
Copy Markdown

Note

Reviews paused

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Review Change Stack

📝 Walkthrough

Walkthrough

The PR adds authenticated admin session list and detail pages. It expands session relation includes, adds session-token UI and translations, supports filtering and deletion, and documents the new session surfaces.

Changes

Session administration

Layer / File(s) Summary
Session relation support
apps/server-core/src/core/entities/session/schema.ts, apps/server-core/test/unit/http/controllers/entities/session-include.spec.ts
Session schemas now support realm, user, and client relations. Tests verify relation hydration and permission-based user omission.
Session-token component and translations
packages/client-web-kit/src/components/entities/..., packages/i18n/src/constants.ts, packages/i18n/src/catalogs/{de,en,es,fr}/*
The web kit exports ASessionTokens. Translation keys and catalogs define session-token statuses, entity labels, session fields, and ALL.
Admin session listing
apps/client-admin-console/config/layout/contants.ts, apps/client-admin-console/pages/sessions/index.vue, apps/client-admin-console/pages/sessions/index/index.vue, .agents/architecture.md, .agents/structure.md
The admin console adds permission-gated navigation and a realm-scoped sessions table with relation includes, filtering, pagination, subject links, current-session labels, and deletion controls. Documentation describes the new session routes and scopes.
Session detail and token inventory
apps/client-admin-console/pages/sessions/[id]/index.vue
The detail page resolves session subjects, displays metadata, supports guarded deletion, and renders paginated session tokens with derived statuses.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Admin
  participant SessionsPage
  participant session-store
  participant SessionDetail
  participant ASessionTokens

  Admin->>SessionsPage: open /sessions
  SessionsPage->>session-store: query sessions with user/client relations
  session-store-->>SessionsPage: return filtered session list
  Admin->>SessionDetail: open a session
  SessionDetail->>session-store: load session and token collection
  session-store-->>SessionDetail: return session metadata and tokens
  SessionDetail->>ASessionTokens: render paginated token inventory
Loading

Possibly related PRs

  • authup/authup#3186: Adds durable session-token inventory and status support used by this UI.
  • authup/authup#3187: Adds session API, schema, permissions, and endpoints used by the admin pages.
  • authup/authup#3373: Adds the account console’s self-service sessions surface related to these admin session pages.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary change: adding an admin sessions overview surface.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/admin-sessions-overview

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
apps/client-admin-console/pages/sessions/index/index.vue (1)

23-28: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Import and register VCTable and VCTimeago explicitly.

The changed page relies on global registration for these components. Import them from their packages and add them to components. This keeps the dependency visible and enables local prop type checks.

Proposed fix
 import type { TableColumn } from '`@vuecs/table`';
+import { VCTable } from '`@vuecs/table`';
 import type { FormOption } from '`@vuecs/forms`';
 import { VCFormSelect } from '`@vuecs/forms`';
 import { VCIcon } from '`@vuecs/icon`';
 import { VCLink } from '`@vuecs/link`';
+import { VCTimeago } from '`@vuecs/timeago`';
 ...
         VCLink,
+        VCTable,
+        VCTimeago,

As per coding guidelines, follow the documented architecture. The structure guide requires explicit imports for new or changed app code.

Also applies to: 33-41, 192-255

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/client-admin-console/pages/sessions/index/index.vue` around lines 23 -
28, Import VCTable and VCTimeago explicitly from their respective packages
alongside the existing component imports, then register both in the page
component’s components option. Update the table and timeago usage in the
sessions page to resolve through these locally registered components, preserving
the existing behavior and enabling local prop type checks.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/client-admin-console/pages/sessions/index/index.vue`:
- Around line 58-62: Update the query computed in the sessions collection to use
the documented top-level filter shape, setting realmId to include both the
active realm ID and null for global sessions. Preserve the existing relations
and seenAt descending sort.

---

Nitpick comments:
In `@apps/client-admin-console/pages/sessions/index/index.vue`:
- Around line 23-28: Import VCTable and VCTimeago explicitly from their
respective packages alongside the existing component imports, then register both
in the page component’s components option. Update the table and timeago usage in
the sessions page to resolve through these locally registered components,
preserving the existing behavior and enabling local prop type checks.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e9180bdb-eeb1-4555-ac5a-33e771ad2fa6

📥 Commits

Reviewing files that changed from the base of the PR and between e341715 and e61400a.

📒 Files selected for processing (28)
  • .agents/architecture.md
  • .agents/structure.md
  • apps/client-admin-console/config/layout/contants.ts
  • apps/client-admin-console/pages/sessions/[id]/index.vue
  • apps/client-admin-console/pages/sessions/index.vue
  • apps/client-admin-console/pages/sessions/index/index.vue
  • apps/server-core/src/core/entities/session/schema.ts
  • apps/server-core/test/unit/http/controllers/entities/session-include.spec.ts
  • packages/client-web-kit/src/components/entities/index.ts
  • packages/client-web-kit/src/components/entities/session-token/ASessionTokens.ts
  • packages/client-web-kit/src/components/entities/session-token/index.ts
  • packages/i18n/src/catalogs/de/app.ts
  • packages/i18n/src/catalogs/de/common.ts
  • packages/i18n/src/catalogs/de/entity.ts
  • packages/i18n/src/catalogs/de/field.ts
  • packages/i18n/src/catalogs/en/app.ts
  • packages/i18n/src/catalogs/en/common.ts
  • packages/i18n/src/catalogs/en/entity.ts
  • packages/i18n/src/catalogs/en/field.ts
  • packages/i18n/src/catalogs/es/app.ts
  • packages/i18n/src/catalogs/es/common.ts
  • packages/i18n/src/catalogs/es/entity.ts
  • packages/i18n/src/catalogs/es/field.ts
  • packages/i18n/src/catalogs/fr/app.ts
  • packages/i18n/src/catalogs/fr/common.ts
  • packages/i18n/src/catalogs/fr/entity.ts
  • packages/i18n/src/catalogs/fr/field.ts
  • packages/i18n/src/constants.ts

@pkg-pr-new

pkg-pr-new Bot commented Aug 9, 2026

Copy link
Copy Markdown

Open in StackBlitz

authup

npm i https://pkg.pr.new/authup@3420

@authup/client-account-console

npm i https://pkg.pr.new/@authup/client-account-console@3420

@authup/client-admin-console

npm i https://pkg.pr.new/@authup/client-admin-console@3420

@authup/client-auth-console

npm i https://pkg.pr.new/@authup/client-auth-console@3420

@authup/server-core

npm i https://pkg.pr.new/@authup/server-core@3420

@authup/access

npm i https://pkg.pr.new/@authup/access@3420

@authup/client-web-kit

npm i https://pkg.pr.new/@authup/client-web-kit@3420

@authup/client-web-kit-theme

npm i https://pkg.pr.new/@authup/client-web-kit-theme@3420

@authup/client-web-nuxt

npm i https://pkg.pr.new/@authup/client-web-nuxt@3420

@authup/client-web-theme

npm i https://pkg.pr.new/@authup/client-web-theme@3420

@authup/core-http-kit

npm i https://pkg.pr.new/@authup/core-http-kit@3420

@authup/core-kit

npm i https://pkg.pr.new/@authup/core-kit@3420

@authup/core-realtime-kit

npm i https://pkg.pr.new/@authup/core-realtime-kit@3420

@authup/errors

npm i https://pkg.pr.new/@authup/errors@3420

@authup/i18n

npm i https://pkg.pr.new/@authup/i18n@3420

@authup/kit

npm i https://pkg.pr.new/@authup/kit@3420

@authup/server-adapter-kit

npm i https://pkg.pr.new/@authup/server-adapter-kit@3420

@authup/server-adapter-node

npm i https://pkg.pr.new/@authup/server-adapter-node@3420

@authup/server-adapter-socket-io

npm i https://pkg.pr.new/@authup/server-adapter-socket-io@3420

@authup/server-adapter-web

npm i https://pkg.pr.new/@authup/server-adapter-web@3420

@authup/server-kit

npm i https://pkg.pr.new/@authup/server-kit@3420

@authup/server-test-kit

npm i https://pkg.pr.new/@authup/server-test-kit@3420

@authup/specs

npm i https://pkg.pr.new/@authup/specs@3420

commit: e61400a

@tada5hi

tada5hi commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator Author

@coderabbitai pause

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
✅ Action performed

Reviews paused.

@tada5hi
tada5hi merged commit 57e8af1 into master Aug 10, 2026
19 checks passed
@tada5hi
tada5hi deleted the feat/admin-sessions-overview branch August 10, 2026 09:25
@github-actions github-actions Bot mentioned this pull request Aug 9, 2026
@github-actions github-actions Bot mentioned this pull request Aug 13, 2026
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

Successfully merging this pull request may close these issues.

2 participants