Your password reset link is a bearer credential: designing signed, single-use tokens that fail closed - DEV Community
A link that carries authority needs three properties a page address never needs: unforgeable, bounded in time, spendable once. Anatomy of a versioned HMAC token, a fixed verification order that fails closed, constant-time comparison across languages, absolute expiry against the server clock, single use as a unique-constraint INSERT instead of SELECT-then-INSERT, scopes instead of subjects in the URL, the four places a link stops being secret (Referer, access logs, browser history, forwarding), rate limiting for the codes that are short on purpose, kid-based key rotation, one uniform external failure with counted internal reasons, and the mutation tests that write themselves.