Idle
MMO.oauth · 1 symbol · generated 30 Nov 2026
Idle
idle.js:11The end of a session left idle (AccessController::$idleTimeout, MMO.config.user.idle): the server ends it once no request came for timeout seconds, so the page warns warning seconds before, offering to stay logged in (a request: user/config.json), and shows the login page once it is over. Every request of the page counts, as on the server: a fetch() resets the count. Nothing happens on a page without MMO.config.user.idle
- Namespace
MMO.oauth
Index
| constructor(options, now) | ||
| state(last, now) | ||
| left() | ||
| touch() | A request was made: the server counts from now | |
| start() | Check every 10 seconds, and count the page's own requests | |
| check() |
Methods6
constructor(options, now)
idle.js:16| options | ||
| now = () => Date.now() | function(): number | the time in milliseconds (a test gives its own) |
state(last, now)
idle.js:31| last = this.last | number | when the last request was, in milliseconds |
| now = this.now() | number | |
| returns | 'active' | 'warning' | 'expired' | where a session of this timeout stands |
left()
idle.js:38| returns | number | the seconds left before the session ends |
touch()
idle.js:43A request was made: the server counts from now
start()
idle.js:49Check every 10 seconds, and count the page's own requests