refactor(auth): replace SMTP with Mailjet, simplify login flow, and fix signup validation#65
Merged
Merged
Conversation
…Mailjet for email delivery
|
✅ PR Validation Passed Your PR title and description meet all requirements:
|
1 similar comment
|
✅ PR Validation Passed Your PR title and description meet all requirements:
|
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.
Summary
Replaces the entire SMTP/Nodemailer email stack with the Mailjet API for transactional email delivery. Refactors the authentication flow so that email OTP verification is only required during sign-up (to confirm the email address) and after a 30-day session expires (re-login). Regular sign-in now creates a session directly without an OTP step. Also removes the disposable email detection system and fixes a bug where sign-up could be submitted with an empty confirm-password field.
Related issue
Fixes #64
Changes
Email Provider
nodemailer,disposable-email-domains,@visulima/disposable-email-domains, and@types/nodemailerpackagesnode-mailjetand rewrotelib/notifyMail.tsto use the Mailjet Send API v3.1SMTP_*andBREVO_API_KEYenv vars withMAILJET_API_KEY,MAILJET_API_SECRET,MAILJET_FROM_EMAIL,MAILJET_FROM_NAMERemoved Files
lib/emailGuard.ts— disposable email detection (3-layer: blocklist + DNS MX)lib/disposable-domains.json— 72k+ domain blocklist (1.2 MB)lib/validateConfig.ts— SMTP env var startup validatorapp/api/admin/refresh-email-blocklist/route.ts— admin endpoint to refresh blocklistAuth Flow Refactor
app/api/auth/login/route.ts— removed OTP generation and email send; now createsLoginSessiondirectly and returns{ user, sessionToken, expiresAt }context/AuthContext.tsx— removedrequiresOtpbranch fromlogin(); regular login now expects session directlycomponents/ApplyModal.tsx—SignInFormstripped of all OTP state and UI; simple email + password → redirect flowBug Fix
components/ApplyModal.tsx—SignUpFormnow explicitly blocks form submission when confirm password is empty, showing a"Please confirm your password"toastCleanup
server.ts— removedlogConfigStatus()import and startup callapp/api/auth/signup/route.ts— removedisDisposableEmailimport and guard blockapp/api/auth/otp/send/route.ts— removed SMTP-specific error codes (EAUTH,535,ECONNREFUSED,ETIMEDOUT)Testing
"Please confirm your password"toast shown (bug fix verified)Checklist
Fixes #64