Email verification is often treated as a small feature: create a token, send a link, and mark the account as verified. In a real backend, the difficult part starts when the user clicks twice, a mail client prefetches the URL, or two browser tabs submit the same token together.
The useful design goal is not merely “the link works.” It is a replay-safe authentication workflow with explicit state, predictable REST API responses, and database rules that remain correct under concurrency.
Why verification links get replayed
A verification link can be opened more than once for normal reasons. A user may refresh the result page, forward the message to another device, or click while the first request is still finishing.…