Skip to content

feat: Add email change via Stytch magic link#399

Open
paulvanbrenk wants to merge 3 commits intomainfrom
pvanbrenk/settings-improvements
Open

feat: Add email change via Stytch magic link#399
paulvanbrenk wants to merge 3 commits intomainfrom
pvanbrenk/settings-improvements

Conversation

@paulvanbrenk
Copy link
Collaborator

Summary

  • Users can now change their email from the Settings page via Stytch magic link verification
  • New dedicated /confirm-email page handles the magic link callback, authenticates the token, syncs the new email, and removes the old email from Stytch
  • Backend POST /api/users/me/confirm-email-change endpoint cleans up old emails from Stytch and updates the DB
  • Stytch client extended with DeleteEmailAsync and full emails array on GetUserAsync

Test plan

  • Enter a new email on Settings, click Send Verification — check email arrives
  • Click magic link — redirected to /confirm-email — see success message
  • Verify Settings page now shows the new email
  • Verify old email is removed from Stytch (only new email remains)
  • Verify GET /api/users/me returns the new email
  • Try logging in with the new email — should work
  • Try logging in with the old email — should fail (removed from Stytch)

🤖 Generated with Claude Code

paulvanbrenk and others added 3 commits February 24, 2026 15:50
Users can now change their email address from the Settings page.
The flow sends a magic link to the new address, verifies ownership
via a dedicated /confirm-email page, then cleans up the old email
from Stytch and syncs to the database.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant