Implement complete forgot password flow - #6
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
- Add reset_token and reset_token_expires fields to User model - Add /auth/forgot-password and /auth/reset-password API endpoints - Implement forgot password UI with email input and success/error states - Add Return to sign in functionality - Style error and success messages to match existing design - Integrate seamlessly with existing login screen Tested end-to-end: forgot password link → email entry → backend API → success message → return to login Co-Authored-By: ben.lehrburger@windsurf.com <ben.lehrburger@windsurf.com>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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.
Implement complete forgot password flow
Summary
This PR implements a complete forgot password flow on the login screen based on the provided Figma design. The implementation includes both frontend UI changes and backend API endpoints to handle password reset functionality.
Key Changes:
reset_tokenandreset_token_expiresfields to User model, plus/auth/forgot-passwordand/auth/reset-passwordAPI endpointsThe flow works as follows: User clicks "Forgot Password" → enters email → receives success message → can return to login form. The backend generates secure reset tokens with 1-hour expiration.
Review & Testing Checklist for Human
secrets.token_urlsafe(32)is sufficient and tokens expire correctly after 1 hourTest Plan: Start both backend (
cd backend && python main.py) and frontend (npm start) servers, navigate to/login, test both forgot password flow and regular login flow.Diagram
%%{ init : { "theme" : "default" }}%% graph TD LoginJS["src/Login.js<br/>React Component"]:::major-edit AppCSS["src/App.css<br/>Styles"]:::minor-edit MainPY["backend/main.py<br/>FastAPI Routes"]:::major-edit DatabasePY["backend/database.py<br/>User Model"]:::major-edit LoginJS -->|"POST /auth/forgot-password"| MainPY LoginJS -->|"uses styles"| AppCSS MainPY -->|"queries User model"| DatabasePY subgraph Legend L1[Major Edit]:::major-edit L2[Minor Edit]:::minor-edit L3[Context/No Edit]:::context end classDef major-edit fill:#90EE90 classDef minor-edit fill:#87CEEB classDef context fill:#FFFFFFNotes
send_reset_email()function currently logs to console for demo purposes. Replace with actual email service (SendGrid, AWS SES, etc.) for productionlocalhost:3001to allowed origins for development testing - review if this should be removed for productionSecurity Note: The forgot password endpoint intentionally returns the same success message regardless of whether the email exists in the system, following security best practices to prevent email enumeration attacks.