Add verified email change flow for customer accounts#442
Merged
Conversation
Let customers change their account email with a confirmation step: a signed, expiring link to the new address must be clicked before the change takes effect. On confirmation the email is swapped atomically, Stripe customer details are synced, and the old address is notified. - email_changes table records old/new email, IP and timestamps, giving a permanent audit trail for addresses that have been reassigned - Composer (plugin repo) credentials hard cut over to the new email; the UI warns about auth.json / CI secrets up front and after the change - Plugin access API now returns a stable user id alongside email Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Reset the new email and password inputs, along with any validation errors, when the change-email modal is dismissed via Cancel. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
simonhamp
marked this pull request as ready for review
July 24, 2026 23:31
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Lets customers change their account email address from Settings → Account, gated behind a verification step so an address is only adopted once its owner proves control of it.
Flow
users.email, setsemail_verified_at, and fires follow-up work.Pending requests show inline with Resend / Cancel; re-requesting supersedes the previous pending row. Requests are rate-limited (3 per 10 min).
Why / design notes
SyncStripeCustomerDetailsJobcalls Cashier'ssyncStripeCustomerDetails()(skips users with no Stripe ID), so receipts and invoices follow the customer.auth.jsonand CI secrets before the change (in the modal) and again in both the confirmation email and the post-change message.email_changestable permanently records old/new email, IP and timestamps, so records tied to a previous address can always be traced back. The plugin access API now also returns a stable useridalongside the email.Scope decisions
Kept intentionally narrow: no Anystack/sub-license propagation and no grace period on old credentials (hard cut). Team membership rows keyed to the old email are updated on confirmation (skipping unique-constraint collisions). Admin-allowlist accounts are out of scope for now.
Testing
tests/Feature/EmailChangeTest.phpcovering the request, validation, rate limiting, resend/cancel, signed/expired/unauthorized confirmation, idempotency, email-taken-after-request, Stripe sync dispatch, team-membership update, and the Composer credential cut-over.SettingsTest,PluginAccessTest,TeamManagementTestandNotificationUnsubscribeTestsuites remain green.🤖 Generated with Claude Code