Skip to content

feat: session-management UI - #3189

Merged
tada5hi merged 6 commits into
masterfrom
feat/session-management-ui
Jul 7, 2026
Merged

tada5hi merged 6 commits into
masterfrom
feat/session-management-ui

Conversation

@tada5hi

@tada5hi tada5hi commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Plan 016 PR G2 — the client-web UI for the session-management API. Stacked on #3187 (base is feat/session-management), so this diff is the UI only; it auto-retargets to master when #3187 merges.

What it adds

  • EntityType.SESSION + EntityTypeMap entry (@authup/core-kit) so the entity-collection manager resolves client.session.
  • ASessions collection component (@authup/client-web-kit), mirroring AUsers.
  • /settings/sessions — a self "active sessions" page (+ a Sessions item in the settings nav). Scoped to the current user (an admin holding SESSION_READ would otherwise see every session; non-admins are self-scoped by the server anyway).
  • /users/:id/sessions — an admin tab on the user-detail page (+ nav item), filtered by user_id, revoke gated on SESSION_DELETE.
  • Both list IP address / user agent / last seen / expires with a per-session revoke (<AEntityDelete entity-type="session"> → client.session.delete, with the built-in confirm dialog).
  • i18n: SESSION entity noun + ipAddress / userAgent / seenAt / expiresAt field labels across en/de/fr/es (the locale-parity test enforces completeness).

Verification

  • Full monorepo build (22 projects) — client-web's build runs nuxi typecheck (vue-tsc), so the SFCs are type-checked; passed.
  • ESLint (incl. the vue-typescript type-aware rules) clean; i18n parity test green; client-web-kit component tests pass.
  • Not yet browser-rendered — I verified statically (build/typecheck/lint), but haven't run the live app to confirm the pages render + the list loads + revoke round-trips. Happy to do a browser pass on request.

Follow-ups (not in this PR)

  • A "log out my other devices" button wired to client.session.deleteMany() (the endpoint exists in feat: session-management API (list + revoke sessions) #3187).
  • The /users/:id/sessions tab shows for anyone who can view the user-detail page; a SESSION_READ-less viewer just sees an empty list (server self-scopes) — could gate the nav item on the permission.

tada5hi added 5 commits July 6, 2026 11:29
Implements plan 016 (Option B, hard cutover). Every /token refresh_token
call rotates; a new auth_session_tokens table holds one durable row per
issued token so replay survives cache flushes and can trigger the RFC 6819
reaction strategy (revoke the whole token family).

- schema: auth_session_tokens (session_id FK ON DELETE CASCADE, kind,
  consumed_at/revoked_at, lineage), widen auth_sessions.ip_address 15 -> 45,
  mysql + postgres migrations
- issuers write a row per access/refresh token when session_id is present
- refresh grant is DB-row-authoritative (skipActiveCheck): atomic consume,
  replay -> soft-revoke family + blocklist jtis + delete session ->
  invalid_grant; /token/revoke soft-revokes the row too
- tokenRefreshGracePeriod (default 0 = strict) scoped to the chain tip
- ISessionManager.revoke(); oauth2-cleaner sweeps expired token rows
- lower tokenAccessMaxAge default 3600 -> 900

BREAKING CHANGE: all in-flight refresh tokens are invalidated on upgrade
(the new table is empty), so active users sign in again once. The default
access-token lifetime drops from 3600s to 900s.
Adds a REST surface over auth_sessions so identities can see and revoke
sessions ("active devices" / force logout). Backend + typed client only;
the client-web UI is a follow-up.

- SESSION_READ / SESSION_DELETE permissions (auto-provisioned; admin=any,
  realm_admin=ownOrNull read / own delete)
- SessionService + SessionController, dual-mounted /sessions and
  /realms/:realmId/sessions:
    GET  /sessions        list (self-scoped without SESSION_READ, else realm-gated)
    GET  /sessions/:id    read one (@me/@self = current session)
    DELETE /sessions/:id  revoke one (own needs no permission)
    DELETE /sessions      revoke all own sessions except the current one
- SessionRepository.findMany / findAllByOwner (list bypasses the id-keyed
  cache); force-selects realm_id/sub/sub_kind so a client `fields` projection
  cannot strip realm_id and neutralize the per-row realm_scope gate
- current session id stashed by the authorization middleware for
  delete-all-but-current
- typed client.session API in @authup/core-http-kit
- deleting a session cascade-drops its auth_session_tokens rows, so a force
  logout also invalidates the subject's refresh tokens

Self-service is inherent: an identity can always list/revoke its own
sessions (ownership = session.sub + sub_kind == actor identity).
Integrate the merged rotation feature (#3186, squash) + SSR internal-http-client
(#3188) from master. Conflict resolutions:
- issuers / refresh grant / session-token repository / grant spec: take master's
  version (inlined row-write + review-fix hardening), dropping the now-removed
  persistSessionTokenRow helper
- architecture.md: keep master's issuer-row wording + this branch's Session
  Management API section
createFakeUser().password is typed string | null (User.password is nullable,
widened by the ...data spread), which failed check:types against
createWithPassword's string param. Pass a known password const instead.
Client-web UI for the session-management API (#3187):

- EntityType.SESSION + EntityTypeMap entry (core-kit)
- ASessions collection component (client-web-kit)
- /settings/sessions self page ("my active sessions") + settings nav item
- /users/:id/sessions admin tab + user-detail nav item
- both list ip_address / user_agent / last-seen / expires with per-session
  revoke via AEntityDelete (entity-type="session"); the self page scopes to
  the current user, the admin tab filters by user_id and gates revoke on
  SESSION_DELETE
- i18n: SESSION entity noun + ipAddress/userAgent/seenAt/expiresAt field
  labels across en/de/fr/es
Copilot AI review requested due to automatic review settings July 6, 2026 13:58
@coderabbitai

coderabbitai Bot commented Jul 6, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

@tada5hi, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 20 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f9ed6148-77fb-4442-8939-52df9dcae18e

📥 Commits

Reviewing files that changed from the base of the PR and between 58fcf93 and c89f9b9.

📒 Files selected for processing (18)
  • apps/client-web/pages/settings/index.vue
  • apps/client-web/pages/settings/index/sessions.vue
  • apps/client-web/pages/users/[id].vue
  • apps/client-web/pages/users/[id]/sessions.vue
  • packages/client-web-kit/src/components/entities/index.ts
  • packages/client-web-kit/src/components/entities/session/ASessions.ts
  • packages/client-web-kit/src/components/entities/session/index.ts
  • packages/core-kit/src/domains/contstants.ts
  • packages/core-kit/src/domains/types.ts
  • packages/i18n/src/catalogs/de/entity.ts
  • packages/i18n/src/catalogs/de/field.ts
  • packages/i18n/src/catalogs/en/entity.ts
  • packages/i18n/src/catalogs/en/field.ts
  • packages/i18n/src/catalogs/es/entity.ts
  • packages/i18n/src/catalogs/es/field.ts
  • packages/i18n/src/catalogs/fr/entity.ts
  • packages/i18n/src/catalogs/fr/field.ts
  • packages/i18n/src/constants.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/session-management-ui

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.

@pkg-pr-new

pkg-pr-new Bot commented Jul 6, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

authup

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

@authup/client-web

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

@authup/server-core

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

@authup/access

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

@authup/client-web-kit

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

@authup/client-web-kit-theme

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

@authup/client-web-nuxt

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

@authup/client-web-theme

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

@authup/core-http-kit

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

@authup/core-kit

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

@authup/core-realtime-kit

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

@authup/errors

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

@authup/i18n

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

@authup/kit

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

@authup/server-adapter-kit

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

@authup/server-adapter-node

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

@authup/server-adapter-socket-io

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

@authup/server-adapter-web

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

@authup/server-kit

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

@authup/server-test-kit

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

@authup/specs

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

commit: c89f9b9

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.

Pull request overview

Adds the client-web UI layer for the new session-management surface (Plan 016 PR G2), wiring a session entity into shared entity infrastructure and exposing session lists + revoke actions in both self-service settings and the admin user-detail area.

Changes:

  • Introduces EntityType.SESSION + EntityTypeMap mapping so collection utilities resolve client.session.
  • Adds ASessions collection component (mirrors existing entity collection components like AUsers).
  • Adds /settings/sessions and /users/:id/sessions pages with session table columns (IP address, user agent, last seen, expires) and revoke via AEntityDelete, plus i18n keys for all supported locales (en/de/fr/es).

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/i18n/src/constants.ts Adds SESSION entity key and new field keys (seenAt, expiresAt, ipAddress, userAgent) for UI labeling.
packages/i18n/src/catalogs/en/entity.ts Adds English pluralization for the session entity noun.
packages/i18n/src/catalogs/de/entity.ts Adds German pluralization for the session entity noun.
packages/i18n/src/catalogs/es/entity.ts Adds Spanish pluralization for the session entity noun.
packages/i18n/src/catalogs/fr/entity.ts Adds French pluralization for the session entity noun.
packages/i18n/src/catalogs/en/field.ts Adds English labels for session table fields.
packages/i18n/src/catalogs/de/field.ts Adds German labels for session table fields.
packages/i18n/src/catalogs/es/field.ts Adds Spanish labels for session table fields.
packages/i18n/src/catalogs/fr/field.ts Adds French labels for session table fields.
packages/core-kit/src/domains/contstants.ts Adds EntityType.SESSION to the shared entity-type enum.
packages/core-kit/src/domains/types.ts Extends EntityTypeMap with Session so generic entity tooling can type-resolve sessions.
packages/client-web-kit/src/components/entities/session/index.ts Adds a barrel export for the new sessions collection component.
packages/client-web-kit/src/components/entities/session/ASessions.ts Implements ASessions as an entity-collection wrapper for sessions with “no more” translation.
packages/client-web-kit/src/components/entities/index.ts Re-exports the new session entity components from the entities module.
apps/client-web/pages/settings/index.vue Adds a “Sessions” item to the settings navigation (translated via entity noun).
apps/client-web/pages/settings/index/sessions.vue Adds self “active sessions” page scoped to current user, with revoke action.
apps/client-web/pages/users/[id].vue Adds “Sessions” tab entry on user detail navigation (translated).
apps/client-web/pages/users/[id]/sessions.vue Adds admin user sessions tab listing sessions filtered by user_id, with revoke gated by SESSION_DELETE.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Base automatically changed from feat/session-management to master July 6, 2026 15:21
@tada5hi

tada5hi commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 7, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@tada5hi tada5hi changed the title feat: session-management UI (plan 016 PR G2) feat: session-management UI Jul 7, 2026
@tada5hi
tada5hi merged commit 7b617c8 into master Jul 7, 2026
12 checks passed
@tada5hi
tada5hi deleted the feat/session-management-ui branch July 7, 2026 08:28
@github-actions github-actions Bot mentioned this pull request Jul 6, 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