You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ensure MAILTRAP_USER and MAILTRAP_PASS environment variables are set and validated before attempting to send emails, otherwise the transporter may be misconfigured or fail silently.
// Configure Nodemailer to use Mailtrap's SMTPconsttransporter=nodemailer.createTransport({host: "live.smtp.mailtrap.io",port: 587,auth: {user: process.env.MAILTRAP_USER,pass: process.env.MAILTRAP_PASS,},
The middleware exempts /auth/reset-password but no such route is registered in auth.ts. Remove the exemption or add the corresponding endpoint implementation to keep routing and middleware in sync.
Parameterize the SMTP host and port using environment variables so you can switch providers without changing code. This also allows you to secure credentials and adapt for production. Provide sensible defaults for development.
Why: Parameterizing host and port via env vars improves configurability across environments without changing code.
Low
Normalize frontend URL
Normalize the frontend URL by trimming any trailing slash to avoid double slashes in your reset link. This ensures consistent link construction regardless of how the env var is set.
Why: Trimming trailing slashes on process.env.FRONTEND_URL prevents double slashes in reset links and ensures consistency.
Low
Add email send error handling
Wrap the sendMail call in its own try/catch to log transporter-specific errors separately and avoid unhandled rejections. This makes debugging email failures easier.
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
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.
PR Type
Enhancement
Description
Implement password reset request endpoint
Configure nodemailer email transporter
Exempt reset routes from authentication check
Update CORS, lint, and dependencies
Changes walkthrough 📝
2 files
Add password reset email logicAdd request-reset API endpoint3 files
Exempt reset routes from auth middlewareExempt reset routes from CSRF protectionAllow additional CORS origin1 files
Disable quotes linting rule1 files
Add nodemailer dependency