Skip to content

Conversation

astratyandmitry
Copy link

This PR introduces support for safe email changes by allowing users to set a unverified_email and confirming it through the standard email verification process.

What's included:

  • unverified_email field added to users table
  • Logic to safely switch verified email after confirmation
  • Automatic cleanup of:
    • Unverified users who reserved the same email
    • Conflicting unverified_email reservations
  • Updates to VerifyEmailController and a new VerifyUserEmail service class
  • Adjustments to the profile view to support pending email changes
  • Event Verified is dispatched after a successful commit
  • Full test coverage for both conflict scenarios

Why?

Previously, a user could set email directly, bypassing email verification and blocking others from using that address. This PR resolves the issue by decoupling pending email updates from the actual verified email and confirming them via a secure flow.

…leanup.

- Introduced unverified_email support for Users wishing to change email
- Added VerifyUserEmail job to handle safe transition and remove conflicts
- Modified VerifyEmailController to use new logic during verification
- Updated migration to include unverified_email column
- Adjusted settings UI to support pending email change
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