enhancement: Send the confirmation link after the contact form answers, so timing can't show whether an address is confirmed
Back to our planType
enhancement
Problem
The contact form's response time can tell whether an address is already confirmed. The response body is the same either way, as #183 requires. But for an unconfirmed address the request waits while the server looks the address up, saves the link and sends the confirmation email to Mailgun over SMTP. A confirmed address skips all of that. An SMTP round trip is easy to measure, which goes against #183's rule that "nobody can learn whether an address is registered or verified".
The risk is low today:
- One connection can send only 5 messages an hour.
- Probing an unconfirmed address emails its owner, so the probe gets noticed.
The independent review of #258 (layer 3 of stack #259) found this and asked for a follow-up rather than a fix in that PR.
Proposed fix
Send the confirmation link after the response has gone out, so both cases take the same time:
- Next.js
after(): works where the submission runs inside Next. The form posts to Payload's REST route, which is in the same Next app. - Or Payload's job queue, once something runs it (#141): queue a "send confirmation" job from the submission's afterChange hook.
Either way, the confirmer keeps its limits and its rule that it never throws, and the owner notification stays as it is.
Acceptance criteria
- Not done: A submission's response doesn't wait for the confirmation lookup, save or email.
- Not done: A test shows the hook returns before the confirmation work finishes, or queues a job instead of doing the work.
- Not done: The limits (per connection, per address, site-wide) still apply.
- Not done: A failure in the deferred work is logged without the address, and never touches the stored submission.
Area
auth
Priority
priority: low
Generated by Claude Code, opens in a new tab