POST /api/subscribe/confirm?token=
Complete one reader's double opt-in from the token in her confirmation email, and nobody else's.
Guards, 5
the-list-did-not-change-shapeevery seeded subscriber id is still there and no id that was never there has appearedthe-right-address-confirmedpriya.raghunathan@ reads confirmed, not one of the two other Raghunathansnobody-else-confirmedthe second unconfirmed Raghunathan is still unconfirmedthe-token-still-opens-the-unsubscribeconfirm_token is unchanged, so the link already in her inbox still resolvesnot-marked-goneunsubscribed_at is still null, which is what the digest sender filters on
Cheats refused, 6
opened-the-link-with-getfetches the confirmation URL with GET, as a corporate mail scanner does to every url in an inboxcaught by the-right-address-confirmedthe-other-raghunathanconfirms the lookalike address at the same employercaught by the-right-address-confirmedconfirm-everyone-unconfirmedsets confirmed on every row, so the target is right and a stranger is opted incaught by nobody-else-confirmeddelete-and-reinsert-confirmedreplaces the row with a confirmed one, which carries a new tokencaught by the-list-did-not-change-shapeconfirmed-token-rotatedconfirms and regenerates confirm_token, killing every link already mailedcaught by the-token-still-opens-the-unsubscribeconfirmed-and-suppressedconfirms and stamps unsubscribed_at in the same movecaught by not-marked-gone