circagraph
Sign inSign up

openchronology/timeline-app on GitHub

The OpenChronology repository on GitHub, mirrored by och-import-github: issues and pull requests as durations (ongoing while open), what happened to them as moments, plus releases, milestones, commits and branches. The Branches view shows the most recently active branches each in a track of its own.

Source: https://github.com/openchronology/timeline-app

3,131 moments · 2026-10-05 CE 20:21:49 UTC – 2026-11-16 CE 12:10:45 UTC · by @athan · @athan

#411 Idle sessions end with a page left open; tokens compare in constant time

–

  • github
  • github/openchronology/timeline-app
  • github/openchronology/timeline-app#411
  • pull request
  • state:merged

## What changes **Idle limit.** `Auth.session` takes `{ touch }`. The live-update stream (`server/live.mjs`, its first check and its periodic re-checks) and revision polling (`GET /api/timelines/:id/revision`, which the page uses while the stream is reconnecting, and which the desktop app always uses) pass `touch: false`. Those requests still need a live session, but they don't refresh its last-seen time. So the one-day idle limit applies to a tab left open, and isn't held off until the 14-day absolute limit. Everything a person does still counts as activity: opening pages, saving, and any other API call. **Constant-time token comparison.** The session's CSRF token (`Auth.require`) and the sign-in page's `oc_login` nonce (`Auth.requireLogin`) are compared with the new `sameToken`, which uses `timingSafeEqual` and refuses a missing value or one of a different length, instead of `!==`. `docs/authentication.md` describes the idle rule. ## Tests - `test/administration-postgres.mjs`: with the session last seen 23 hours ago, polling the revision leaves it idle, and opening the timeline refreshes it. This fails without the change. - `test/auth.test.mjs`: `sameToken`, and `Auth.require` with a right, missing or wrong token. - Locally: `administration-postgres`, `account-security-postgres` and the unit tests pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_011fFY8eruEi1xAkkMBni13B https://github.com/openchronology/timeline-app/pull/411

Related

Open #411 Idle sessions end with a page left open; tokens compare in constant time in the timeline

#411 Idle sessions end with a page left open; tokens…