Write apps/backend/docs/concepts-nonce-lifecycle.md for lib/nonce.ts: how challenge nonces are minted, stored, consumed and expired, for both the sign-in challenge and the separate device-link challenge.
Acceptance criteria:
- Documents creation, single-use consumption and TTL for both nonce kinds
- Explains why device-linking uses a separate nonce namespace from sign-in, so hammering one flow cannot lock out the other
- Documents where nonces live and the behaviour across a restart or in a multi-node deployment
- Explains the replay resistance this provides and its limits
Write
apps/backend/docs/concepts-nonce-lifecycle.mdforlib/nonce.ts: how challenge nonces are minted, stored, consumed and expired, for both the sign-in challenge and the separate device-link challenge.Acceptance criteria: