You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- platform-objects: sys_session.{last_activity_at, revoked_at, revoke_reason}.
- service-settings: session_idle_timeout_minutes, session_absolute_max_hours,
max_concurrent_sessions_per_user (all 0 = off).
- plugin-auth:
- customSession enforces idle + absolute per request: touch last_activity_at
(throttled ~1/min); revoke (expire-in-place + revoked_at/revoke_reason) once
the idle window or absolute cap is exceeded.
- sign-in after-hook enforces the concurrent cap: keep the newest N live
sessions, revoke the rest (oldest first).
- revocation expires the session in place so better-auth returns null next
request -> existing 401 -> login redirect; no client change.
Default-off / additive; ADR-0049. better-auth GCs expired sessions, so the
revoke audit is best-effort; the enforcement is not.
Verified live (dogfood): concurrent cap=2 + 3 sign-ins -> oldest session
revoked (revoke_reason=concurrent_cap), 2 newest alive; idle=15m with a
backdated last_activity -> session killed on the next request. Unit:
plugin-auth 203 + service-settings 129 + platform-objects 63 green; full build
incl. strict DTS green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Auth: session controls — idle timeout, absolute max lifetime, concurrent cap (ADR-0069 D4, P2)
8
+
9
+
Adds three `auth` session-control settings (all 0 = off):
10
+
11
+
-`session_idle_timeout_minutes` — sign a user out after inactivity. Enforced in `customSession`: touches `sys_session.last_activity_at` (throttled to once a minute) and, once the idle window is exceeded, revokes the session.
12
+
-`session_absolute_max_hours` — cap total session lifetime regardless of refresh; revoked once `created_at` is older than the cap.
13
+
-`max_concurrent_sessions_per_user` — on sign-in, keep the newest N live sessions and revoke the rest (oldest first).
14
+
15
+
Revocation expires the session in place (`expires_at` set to the past + `revoked_at` / `revoke_reason` stamped on new `sys_session` columns), so better-auth returns no session on the next request → the Console's existing 401 → login redirect handles it (no client change). Note: better-auth garbage-collects expired sessions, so the `revoke_reason` audit row is best-effort; the enforcement (session killed) is not.
16
+
17
+
Default-off / additive (no upgrade behavior change); per ADR-0049 each setting ships with its enforcement.
0 commit comments