Repository navigation
feat(auth): send password reset emails via SendGrid or SMTP - #1018
Merged
devanshi14malhotra merged 1 commit intoMay 28, 2026
Merged
devanshi14malhotra merged 1 commit into
devanshi14malhotra merged 1 commit into
Conversation
Add email_service and wire forgot-password to deliver reset links in production. Keep dev-only reset_url when email is not configured. Fixes devanshi14malhotra#762
✅ Deploy Preview for bibliodrift-dm ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
Description
Adds real email delivery for the existing password reset flow (forgot/reset API + auth UI).
backend/email_service.pyreadsEmailConfigand sends reset links via Sendgrid (HTTP API) or SMTP (smtplib).POST /api/v1/auth/forgot-passwordsends email whenEMAIL_*is configured;reset_urlis only returned in development when email is not configured (same security model as before for prod).EmailConfigandconfig/.env.examplewith SMTP settings andFRONTEND_ORIGINfor links in emails.test_email_service.py,test_forgot_password_email.py; fixedconftest.pyto use the samedbinstance asbackend.app.Related Issue
Fixes #762
Type of Change
Testing
export GOOGLE_BOOKS_API_KEY=fake-key-for-testing JWT_SECRET_KEY=test-jwt-secret-key DATABASE_URL=sqlite:///:memory: python3 -m pytest tests/test_email_service.py tests/test_forgot_password_email.py tests/test_password_reset.py -v