trails/openspec/specs
Ullrich Schäfer f16e80a2eb
Prompt users with stale terms_version to re-accept
The three pre-legal-disclaimer users (ullrich, pistazie, nelli) have
NULL terms_version, and any future Terms update would leave every
existing user in the same state. Close the loop now that we have
version storage by redirecting any logged-in user whose
users.terms_version doesn't match the currently-published
TERMS_VERSION to a dedicated acceptance page.

Changes:
- auth.server: new recordTermsAcceptance(userId, version) helper that
  writes both terms_accepted_at and terms_version.
- root loader: if the session user has a stale or NULL terms_version,
  throw redirect("/auth/accept-terms?returnTo=<pathname>") unless the
  request is already on an allow-listed path
  (/auth/accept-terms, /auth/logout, /legal/*) so Terms are reachable
  and logout works.
- New route /auth/accept-terms (GET renders the prompt, POST records
  acceptance and bounces to a sanitised returnTo). Same-origin check
  on returnTo to avoid open-redirect abuse. Logout button is provided
  as an escape hatch.
- i18n: new auth.reaccept.* keys for EN and DE.
- Spec: new Requirement + five scenarios (redirect, allow-list,
  successful re-accept, missing consent, returnTo sanitisation).

No action on the three legacy users is required beyond what they'll
experience on their next visit — the gate takes care of it.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 08:06:16 +02:00
..
account-settings Fix all OpenSpec validation failures (36/36 passing) 2026-04-06 22:17:52 +02:00
activity-feed Fix all OpenSpec validation failures (36/36 passing) 2026-04-06 22:17:52 +02:00
brouter-integration Fix all OpenSpec validation failures (36/36 passing) 2026-04-06 22:17:52 +02:00
crash-recovery Fix all OpenSpec validation failures (36/36 passing) 2026-04-06 22:17:52 +02:00
elevation-map-interaction Fix all openspec validation errors (45/45 pass) 2026-04-12 22:41:51 +02:00
gpx-import Update specs: session-notes, route-coloring, gpx-import 2026-04-11 03:24:54 +02:00
infrastructure Fix all OpenSpec validation failures (36/36 passing) 2026-04-06 22:17:52 +02:00
journal-auth Prompt users with stale terms_version to re-accept 2026-04-19 08:06:16 +02:00
legal-disclaimers Realign legal-disclaimers spec with post-review implementation 2026-04-19 07:33:27 +02:00
local-dev-environment Fix all OpenSpec validation failures (36/36 passing) 2026-04-06 22:17:52 +02:00
map-core Fix all openspec validation errors (45/45 pass) 2026-04-12 22:41:51 +02:00
map-display Fix all openspec validation errors (45/45 pass) 2026-04-12 22:41:51 +02:00
multi-day-routes Fix all openspec validation errors (45/45 pass) 2026-04-12 22:41:51 +02:00
no-go-areas Fix all OpenSpec validation failures (36/36 passing) 2026-04-06 22:17:52 +02:00
observability Fix all OpenSpec validation failures (36/36 passing) 2026-04-06 22:17:52 +02:00
osm-poi-overlays Fix all openspec validation errors (45/45 pass) 2026-04-12 22:41:51 +02:00
osm-tile-overlays Fix all openspec validation errors (45/45 pass) 2026-04-12 22:41:51 +02:00
planner-journal-handoff Fix all OpenSpec validation failures (36/36 passing) 2026-04-06 22:17:52 +02:00
planner-session Fix all openspec validation errors (45/45 pass) 2026-04-12 22:41:51 +02:00
rate-limiting Fix all OpenSpec validation failures (36/36 passing) 2026-04-06 22:17:52 +02:00
road-type-coloring Add road type color mode to route visualization 2026-04-11 11:13:43 +02:00
route-coloring Update route-coloring spec with all 10 modes, create follow-up changes 2026-04-11 11:20:17 +02:00
route-drag-reshape Fix all OpenSpec validation failures (36/36 passing) 2026-04-06 22:17:52 +02:00
route-management Fix all OpenSpec validation failures (36/36 passing) 2026-04-06 22:17:52 +02:00
route-preview Fix all OpenSpec validation failures (36/36 passing) 2026-04-06 22:17:52 +02:00
route-splitting Fix all OpenSpec validation failures (36/36 passing) 2026-04-06 22:17:52 +02:00
secret-management Fix all OpenSpec validation failures (36/36 passing) 2026-04-06 22:17:52 +02:00
security-hardening Fix all OpenSpec validation failures (36/36 passing) 2026-04-06 22:17:52 +02:00
session-notes Sync notes through GPX, Journal, and Planner roundtrip 2026-04-11 03:35:40 +02:00
shared-packages Fix all OpenSpec validation failures (36/36 passing) 2026-04-06 22:17:52 +02:00
transactional-emails Fix all OpenSpec validation failures (36/36 passing) 2026-04-06 22:17:52 +02:00
wahoo-import Fix all OpenSpec validation failures (36/36 passing) 2026-04-06 22:17:52 +02:00