The forgot password feature is already implemented but needs email configuration to send reset links.
-
Enable 2-Factor Authentication on your Gmail account
-
Generate App Password:
- Go to: https://myaccount.google.com/apppasswords
- Select "Mail" and your device
- Copy the 16-character password
-
Update
.envfile:
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your-email@gmail.com
SMTP_PASS=your-16-char-app-password
SMTP_FROM=noreply@taskflow.com
FRONTEND_URL=http://localhost:3000- Sign up at https://sendgrid.com
- Create API Key in Settings > API Keys
- Update
.env:
SMTP_HOST=smtp.sendgrid.net
SMTP_PORT=587
SMTP_USER=apikey
SMTP_PASS=your-sendgrid-api-key
SMTP_FROM=noreply@yourdomain.com
FRONTEND_URL=https://yourdomain.comIf you don't configure SMTP, password reset emails will be logged to console instead of sent.
This is useful for development/testing without email setup.
curl -X POST http://localhost:3000/api/auth/forgot-password \
-H "Content-Type: application/json" \
-d '{"email": "user@example.com"}'- With SMTP: Check email inbox for reset link
- Without SMTP: Check server console for output like:
Email preview (dev mode): From: noreply@taskflow.com To: user@example.com Subject: Password Reset Request Reset link: http://localhost:3000/reset-password?token=abc123...
curl -X POST http://localhost:3000/api/auth/reset-password \
-H "Content-Type: application/json" \
-d '{"token": "TOKEN_FROM_EMAIL", "newPassword": "newpass123"}'✅ Password reset API endpoints are working ✅ Email templates are ready ❌ SMTP configuration needed to send emails
To enable email sending, update .env with your SMTP settings and restart the server.
"Failed to send password reset email" - Check:
- SMTP credentials are correct
- SMTP_PORT is correct (587 for TLS, 465 for SSL)
- Firewall allows outbound SMTP connections
- Gmail: App password is used (not regular password)
No email received - Check:
- Spam/junk folder
- Email address is correct in database
- Server logs for errors