feat(backend): sign people out after N days without use (auth.idle_days, default 14)
Platform-v2 step 2.99d, owner decision 2026-11-14. - New core setting auth.idle_days (int, default 14, 0 = never). A manager, waiter or paired-device session unused for that long ends with reason "idle" on its next request (sessions.validate) or when someone opens "Signed in now" (sessions.end_idle in GET /api/auth/sessions). Support keeps its own 4 h expiry. - Manager: Settings -> Sign-in & security -> "Sign people out after" (7/14/30/60/90 days / Never; a value set elsewhere is kept); "Signed in now" names the reason. Texts en/el. - Tests: backend 284 (+ 14-day default, list drops idle ones, setting incl. 0); manager e2e checks the default and saving 30. The support-access check that failed once in ~8 runs now saves a screenshot and the page's alert text. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -294,6 +294,7 @@ def list_sessions(request: Request, include_ended: bool = False, db: Session = D
|
||||
"""Active sessions (optionally the last 200 ended ones too), newest first. `current`
|
||||
marks the caller's own session; `device_name`/`device_app` name a terminal's device."""
|
||||
from models.device import Device
|
||||
sessions.end_idle(db) # so "Signed in now" never lists someone gone for weeks (auth.idle_days)
|
||||
q = db.query(LoginSession)
|
||||
if not include_ended:
|
||||
q = q.filter(LoginSession.ended_at.is_(None))
|
||||
|
||||
Reference in New Issue
Block a user