Skip to content

🕵️ fix: Redact Email Addresses and IPs From Auth Flow Logs - #16994

Merged
berry-13 merged 11 commits into
devfrom
berry-13/redact-auth-email-logs
Oct 12, 2026
Merged

berry-13 merged 11 commits into
devfrom
berry-13/redact-auth-email-logs

Conversation

@berry-13

@berry-13 berry-13 commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The registration, email verification, resend verification and password reset paths in AuthService interpolated the user's email into info, warn and error logs, the reset request for an unknown address also logged req.ip, and a registration validation failure logged the whole raw request body (email, name, username). The email change flow in packages/api/src/auth/email.ts logged old and new addresses the same way.

These logs now identify the user by opaque id where one exists and omit the address when no user was found. The anonymous reset lookup no longer logs the IP, and the validation failure logs only the validation message. The email change audit lines keep the user id and IP, since those are a security trail for account changes, but drop the addresses. Redaction stays at the call sites rather than changing the global log format.

Stacked on #16993.

Type of change

  • Bug fix

Testing

Tested environments/configuration:

  • Log-line changes only, no runtime config involved.

Automated tests:

  • api: npx jest server/services/AuthService.spec.js: 72 passed, including a new test that the validation-failure log carries no email, username or name.
  • packages/api: npx jest src/auth/email: 55 passed.
  • npx tsc --noEmit -p packages/api/tsconfig.json: no errors.
  • npx eslint and npx prettier --check on changed files: clean.

Screenshots / recordings

No user-facing change

Risk / compatibility

Operators who grep logs by email address will now need to search by user id instead.

Checklist

  • I reviewed my own changes
  • Relevant tests have been added or updated
  • Existing relevant tests pass
  • The change does not introduce new warnings or errors
  • Required documentation PR: N/A

@berry-13
berry-13 marked this pull request as ready for review October 11, 2026 22:14
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-12T05:08:09.550019Z 0f48cc6 New commits
🔒 Security Review ✅ Completed 2026-10-11T22:17:02.406133Z 90cde28 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 90cde286b7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread api/server/services/AuthService.js
Comment thread api/server/services/AuthService.js
Comment thread packages/api/src/auth/email.ts
Comment thread api/server/services/AuthService.js
Comment thread api/server/services/AuthService.js Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b16ad237ca

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread api/server/services/AuthService.js
Comment thread packages/api/src/auth/email.ts
Comment thread api/server/services/AuthService.js Outdated
Base automatically changed from berry-13/redact-delete-email-log to dev October 12, 2026 08:50
@berry-13
berry-13 merged commit ee1d59e into dev Oct 12, 2026
35 checks passed
@berry-13
berry-13 deleted the berry-13/redact-auth-email-logs branch October 12, 2026 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant