bug: reopening a used confirmation link asks to confirm again instead of saying it is already confirmed
Back to our planProblem
Someone confirms their email, later opens the same link from their inbox again, and the page still shows Confirm as if nothing happened. That's confusing: they wonder whether the first click worked, and clicking again does nothing useful.
Summary of the owner's request (2026-10-25, Claude chat): when a person has already confirmed their email and clicks the confirm link again, they shouldn't see "Confirm your account" or "Confirm your email" again. Instead the page should check, then show a message that it has already been confirmed, with no button.
Applies to both confirmation pages:
/confirm-email(contact senders, our own hashed token, decision 0009)/verify-account(new accounts, Payloadauth.verify)
Proposed fix
When the page loads, check the link's status (read-only, no state change) and render one of:
- Not confirmed yet: today's page (Confirm button + robot check), unchanged.
- Already confirmed: a plain message such as "This email is already confirmed." with no button. On
/verify-account, offer a link to sign in. - Expired or invalid: today's error message, unchanged.
Implementation notes:
- The status check must not confirm anything. Confirming still takes the button and the robot check (#303), so mail scanners opening the link still confirm nothing.
- Payload clears
_verificationTokenonce an account is verified, so a reused/verify-accountlink can't be told apart from a bad one today. Check native Payload first (ladder); if nothing tells us, keep a hashed record of used verification tokens (one server-only field per account, deleted with the account; see the decision comment below) so the page can recognise them./confirm-emailkeeps its confirmation record, so its status should already be readable, until retention deletes it (decision 0010). After that, the invalid/expired message is fine. - The answer must not reveal anything beyond what the link holder already knows: no email address and no account details. Answer only for a valid token.
Acceptance criteria
- Not done: Opening a
/confirm-emaillink a second time after confirming shows "already confirmed" and no Confirm button. - Not done: Same for
/verify-account, with a sign-in link. - Not done: An unconfirmed link still shows the Confirm button and robot check; loading the page alone confirms nothing (test).
- Not done: An invalid or expired link still shows the existing error.
- Not done: Tests cover all three states on both pages; checked on a phone.
Area
frontend, auth
Priority
medium
Generated by Claude Code, opens in a new tab