gpt-engineer
gpt-engineer copied to clipboard
Enhancement in email
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
ChangeEmailForminchangeemailform.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
UserAPIclass inai.pyfor handling email change requests and verification.- Implements
UserServiceinuser_service.pyfor managing email change logic and token validation.- Introduces
EmailServiceinemail_service.pyfor sending verification and notification emails.- Adds routes in
routers.pyfor email change, verification, and cancellation.- Database:
- Updates
Usermodel inmodels.pywith fields for pending email, verification token, and token creation time.- Adds
EmailChangeLogmodel for logging email change requests.- Configuration:
- Updates
.env.templatewith SMTP and database configurations.- Adds
ProjectConfiginproject_config.pyfor email change settings.- Misc:
- Initializes Flask app in
app.pyand registers user blueprint.This description was created by
for d469ce310514fa990d1196791dd47f6b3f09d2a0. You can customize this summary. It will automatically update as commits are pushed.