Repository navigation
feat(auth): email reset/verify links over SMTP instead of logging tokens - #493
Merged
Merged
Conversation
Reset and verification links carried live tokens in logger.info, so anyone with log access could take over an account. - src/services/mail.ts (new): sendAuthLinkEmail via Nodemailer SMTP (SMTP_HOST/PORT/USER/PASS, MAIL_FROM, APP_URL), plain text in the ?lang= language, 10s SMTP timeouts; SMTP_HOST or APP_URL unset -> dev logs the link, prod warns without it and sends nothing - src/auth/auth.service.ts: register and forgot-password email the link fire-and-forget (no response-time difference for registered emails, a failed send keeps the generic response and is logged by message only); prod forgot-password logs only the candidate id - src/locales/vi.ts, en.ts: mail subject/body strings - src/utils/passwordReset.ts, emailVerification.ts, src/routers/api/v1/auth.route.ts: stale stub comments/summaries updated - tests: auth.service.test.ts mocks the mail module (send asserted, no token in prod logs, failure path, no await); new services/mail.test.ts with nodemailer mocked - package.json/package-lock.json: nodemailer ^10.6.0 (6.x had open high advisories), @types/nodemailer - .env.example, CLAUDE.md, .claude/rules/api.md, README.md: new env vars, stub wording removed npm test: Test Suites: 76 passed, 76 total / Tests: 801 passed, 801 total npm run build: exit 0 (tsc typecheck); lint 273 problems (<= 274 baseline), none new in changed files Node: email-auth-links (SEALED) Evidence: agent-hub/evidence/verifier/2026-11-19/email-auth-links-seal.md Closes #461 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This was referenced Nov 19, 2026
Merged
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.
32cbe39 feat(auth): email reset/verify links over SMTP instead of logging tokens
Closes #461