Platform & Access · Idle auto-logout
Per-centre inactivity timer that warns the user and then ends the session. The timeout in minutes is configured on the centre’s
auto_logoutmodule.
| Area | Platform & Access |
| Routes | (application-wide) |
| Centre modules | auto_logout |
| Staff levels | all |
| Models | module-auto-logout |
| UI label | modal.logout.description |
| Coverage | 2 use cases · 2 happy · 3 failure |
Known issues (2)
How it works
The monitor listens to mousemove, mousedown, keypress and touchmove on window and restarts an Ember later() timer on each event. It is a no-op when the module is disabled or minutes is unset. The application controller exposes keepSessionActive and logoutNow, plus minutesBeforeLogout for the warning copy. Note willDestroy removes listeners using fresh .bind(this) references, so those removeEventListener calls do not actually detach the original handlers — a real leak if the service is ever torn down.
Use cases
Why someone opens this (2)
- A shopping-centre back office on a shared desktop where unattended sessions must not stay open.
- Centres with stricter data-protection requirements enabling a short window while others leave it off.
Path map
flowchart LR F(["Idle auto-logout"]):::feat F --> H1["Session kept alive"]:::ok F --> H2["Idle session closed"]:::ok F -.-> X1["Module enabled but minutes unset"]:::bad F -.-> X2["Centre not loaded yet"]:::bad F -.-> X3["Unsaved work lost"]:::bad classDef feat fill:#4a5c8a,stroke:#4a5c8a,color:#ffffff,font-weight:bold classDef ok fill:#e3f1ea,stroke:#0d6b42,color:#0d4a2e classDef bad fill:#f7e6e2,stroke:#9a2d1c,color:#6e1f13
Happy paths
Session kept alive
- Centre has
auto_logout.enabledwith e.g. 15 minutes.- User is idle; the timer fires and the warning modal appears with the remaining minutes.
- User clicks ‘keep session active’; the timer resets and work continues.
Idle session closed
- User walks away; no input events arrive before the timeout.
logoutis triggered, the session is invalidated and the app returns to the login screen.
Failure paths
Module enabled but minutes unset
Cause —
auto_logout.minutesis undefined.What happens —
logout()returns early andmsBeforeLogoutis 0 — the feature silently does nothing, so a half-configured centre believes it is protected when it is not.
Centre not loaded yet
Cause —
auth.centeris still null during boot.What happens —
resetTimer/msBeforeLogoutguard on the missing centre and skip scheduling until it is available.
Unsaved work lost
Cause — Logout fires while a long multi-step form (campaign, proposal, centre) is half-filled.
What happens — No draft persistence — the in-memory records are discarded with the session. A known UX risk on long wizards.
QA checklist
Tick these off while regression-testing this feature. The boxes are plain Markdown, so progress is visible in git diffs.
- ✅ Session kept alive
- ✅ Idle session closed
- ⛔ Module enabled but minutes unset
- ⛔ Centre not loaded yet
- ⛔ Unsaved work lost
Implementation
Translation keys (2)
Key English modal.logout.descriptionAttention, the session will be closed in modules-auto-logoutAutologout
Related
- Same area — Staff login · Password reset request · Password update from reset link · Change own password · Centre switching & multi-centre scoping · Server-incident banner · Desktop (home dashboard) · Runtime environment & white-label boot · Back-office interface language · In-app help & support chat (Froged)
Generated from doc/feature-inventory.json · id platform-auto-logout · commit 276788ca6