Skip to content

📧 fix: Log User IDs Instead of Emails in Admin Panel Auth Flow - #17032

Merged
berry-13 merged 4 commits into
devfrom
berry-13/admin-oauth-email-logs
Oct 13, 2026
Merged

berry-13 merged 4 commits into
devfrom
berry-13/admin-oauth-email-logs

Conversation

@berry-13

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

Copy link
Copy Markdown
Collaborator

Summary

Every admin-panel login wrote the user's email address into the logs. The OAuth callback logged it at info level when redirecting with an exchange code, and the admin exchange, token refresh and requireAdmin paths logged it too. The central redaction format has no email rule, so the address reached the log sink in plaintext. These log lines now carry the opaque user id instead, which is enough to trace a login.

Type of change

  • Bug fix

Testing

Tested environments/configuration:

  • Admin panel OAuth login, exchange, refresh and admin access check.

Automated tests:

  • admin.spec.ts and refresh.spec.ts now assert the user id is logged and the email is not.
  • npx jest src/middleware/admin.spec.ts src/auth in packages/api: all pass.
  • npx tsc --noEmit -p packages/api/tsconfig.json, eslint and prettier on changed files: clean.
  • New mock scenarios in admin-auth-log-ids.spec.ts: an unknown admin exchange code still gets 401 with no user data, and a non-admin is still denied /api/admin/verify without the response echoing their email (desktop light, dark and mobile: pass).

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

@berry-13 berry-13 changed the title berry-13/admin-oauth-email-logs 📧 fix: Log User IDs Instead of Emails in Admin Panel Auth Flow Oct 12, 2026
@berry-13
berry-13 added this pull request to stack #17034 October 12, 2026 18:00
@berry-13
berry-13 marked this pull request as ready for review October 12, 2026 18:13
Copilot AI balanced review requested due to automatic review settings October 12, 2026 18:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 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-12T20:40:01.000808Z 0ef683f New commits
🔒 Security Review ✅ Completed 2026-10-12T18:17:21.638097Z c0a3ee0 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: c0a3ee0e84

ℹ️ 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 e2e/specs/mock/scenarios/admin-auth-log-ids.spec.ts
Base automatically changed from berry-13/actions-auth-console-log to dev October 12, 2026 20:35
@berry-13
berry-13 force-pushed the berry-13/admin-oauth-email-logs branch from c0a3ee0 to 20744a5 Compare October 12, 2026 20:35
@berry-13
berry-13 merged commit c0f7822 into dev Oct 13, 2026
37 checks passed
@berry-13
berry-13 deleted the berry-13/admin-oauth-email-logs branch October 13, 2026 06:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants