Repository navigation
Mail issues - #256
Mail issues#256 8 commits merged into
Conversation
- Add connection pooling and reusable transporter to nodemailer configuration - Validate EMAIL_ID and EMAIL_PASSWORD with early return to avoid network timeouts - Introduce critical flag so notification failures log instead of throwing - Support dynamic FRONTEND_URL in emailTemplates instead of hardcoded domain
…gnup failure - Resolve broken URL concatenation by extracting clean origin via getFrontendBaseUrl helper - Automatically roll back user record if verification email fails during signup to prevent lockout - Eliminate manual bcrypt hashing in resetPassword to prevent double-hashing - Make alumni verification notification email non-blocking to prevent false failure responses - Add POST /auth/resend-verification endpoint for expired or missing verification tokens
…il notifications - Wrap notification email dispatch in try-catch so SMTP errors do not fail core operations - Prevent self-notifications for post authors commenting or asking questions on their own posts - Add recipient email fallback to instituteEmail/personalEmail across notification flows
… non-blocking - Support personalEmail for alumni and users without instituteEmail on achievement submission - Wrap achievement notification dispatch in try-catch so submission succeeds even if email fails
…eholders - Document EMAIL_ID, EMAIL_PASSWORD, and FRONTEND_URL - Include server port and CORS origin setup guide
… EditPost - Check for token existence before initiating post create or update requests - Catch 401 responses, clear expired token, show user-friendly message, and redirect to login
- Use port 465 with direct SSL for reliable cloud delivery - Strip accidental whitespace from EMAIL_PASSWORD - Remove socket pooling to prevent frozen serverless connection timeouts - Add explicit socket, greeting, and connection timeouts
| } | ||
| console.error("Error creating post:", error); | ||
| } | ||
| }; |
There was a problem hiding this comment.
This patch improves the create-post flow by handling unauthenticated users before the request is sent and by gracefully handling expired sessions with a clearer message and redirect. The error handling is more user-friendly and avoids leaving stale auth state behind. No blockers from this diff
| } catch (emailErr) { | ||
| console.error("Non-blocking error sending answer notification email:", emailErr); | ||
| } | ||
|
|
There was a problem hiding this comment.
This change improves reliability by ensuring answer notifications do not block the answer creation flow if email delivery fails. The fallback to instituteEmail and non-blocking error handling are sensible, and they reduce user-facing disruption without changing the main business logic.
| verifyPasswordResetEmail, | ||
| resetPassword, | ||
| resendVerificationEmail, | ||
| }; No newline at end of file |
There was a problem hiding this comment.
Approved with minor note: the patch is a clear improvement and addresses real reliability issues in signup/reset email flows. The safer URL construction, rollback on email failure, and more resilient handling of verified/unverified states are all positive. I’d only suggest adding a couple of focused tests for the URL-generation edge cases and the resend/forgot-password flows to prevent regressions.
No description provided.