gpt-engineer icon indicating copy to clipboard operation
gpt-engineer copied to clipboard

Enhancement in email

Open ABDULHALEEL opened this issue 1 month ago • 0 comments

What It Does Lets users change their email address securely.

How It Works User requests email change → Enters new email and password

System sends verification email → Link sent to new email

User clicks verification link → Confirms they own the new email

Email gets updated → Old and new emails get notified

Key Features Secure - Requires verification before changing

User-friendly - Simple web interface

Reliable - Handles errors and duplicates

Fast - Quick verification process

Technology Python + Flask - Web server

Token verification - Secure email confirmation

Web interface - Easy testing

Use Cases User changes jobs and needs new work email

Old email becomes inactive

Personal preference for different email provider


[!IMPORTANT] This PR adds a secure email change feature with verification, involving frontend, backend, and database updates.

  • Behavior:
    • Users can request email changes via ChangeEmailForm in changeemailform.jsx, requiring current password and new email.
    • Verification email sent to new email; both old and new emails receive notifications.
    • Email change verified through a token, expiring in 24 hours.
  • Backend:
    • Adds UserAPI class in ai.py for handling email change requests and verification.
    • Implements UserService in user_service.py for managing email change logic and token validation.
    • Introduces EmailService in email_service.py for sending verification and notification emails.
    • Adds routes in routers.py for email change, verification, and cancellation.
  • Database:
    • Updates User model in models.py with fields for pending email, verification token, and token creation time.
    • Adds EmailChangeLog model for logging email change requests.
  • Configuration:
    • Updates .env.template with SMTP and database configurations.
    • Adds ProjectConfig in project_config.py for email change settings.
  • Misc:
    • Initializes Flask app in app.py and registers user blueprint.

This description was created by Ellipsis for d469ce310514fa990d1196791dd47f6b3f09d2a0. You can customize this summary. It will automatically update as commits are pushed.

ABDULHALEEL avatar Oct 09 '25 13:10 ABDULHALEEL