Email Change Verification Is Sent to the Old Address
Level 1 · node · Correctness · Changed-value propagation error
Scenario
An account email change should send a verification code to the new address while keeping the current address until verification completes. The request correctly stores pendingEmail, but the verification message is sent to the current account.email, so the user cannot receive the code at the new address. The account repository and verification sender are separated.
Requirements
- Store newEmail as pendingEmail for an email-change request - Send the verification code to newEmail - Keep account.email unchanged before verification - Requests for different users send to each corresponding new address - The returned pendingEmail and send target must match
Acceptance criteria
- New email is stored as pendingEmail
- Verification is sent to the new email
- Current account.email remains unchanged
- Another user receives verification at their own new address
- Returned pendingEmail matches the send target