fix(audit-log): resolve userName/userEmail for JWT and API key auth paths#3262
Merged
waleedlatif1 merged 1 commit intostagingfrom Feb 20, 2026
Merged
fix(audit-log): resolve userName/userEmail for JWT and API key auth paths#3262waleedlatif1 merged 1 commit intostagingfrom
waleedlatif1 merged 1 commit intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
Greptile SummaryThis PR fixes a gap in audit logging where JWT and API key authentication paths were leaving Key changes:
Issues found:
Confidence Score: 4/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[recordAudit called] --> B[insertAuditLog async]
B --> C{actorName === undefined<br/>AND<br/>actorEmail === undefined?}
C -->|Yes| D[Query user table<br/>by actorId]
C -->|No| H[Use provided values]
D --> E{Query succeeds?}
E -->|Yes, user found| F[Set actorName & actorEmail<br/>from DB row]
E -->|Yes, not found| G[Set both to undefined]
E -->|No, error| G
F --> I[Insert audit log]
G --> I
H --> I
I --> J{Insert succeeds?}
J -->|Yes| K[Log debug success]
J -->|No| L[Log error, never throw]
Last reviewed commit: f6b626a |
adc0f2e to
22bb747
Compare
Collaborator
Author
|
@greptile |
Collaborator
Author
|
@cursor review |
1 similar comment
Collaborator
Author
|
@cursor review |
Collaborator
Author
|
bugbot run |
22bb747 to
163b35d
Compare
163b35d to
80e2803
Compare
Collaborator
Author
|
@cursor review |
Collaborator
Author
|
bugbot run |
Collaborator
Author
|
@greptile |
80e2803 to
2cd10b2
Compare
Collaborator
Author
|
@cursor review |
Collaborator
Author
|
@greptile |
2cd10b2 to
f6b626a
Compare
Collaborator
Author
|
@greptile |
Collaborator
Author
|
bugbot run |
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
userName/userEmailvia a PK lookup on theusertableAuthResult, leaving audit log entries from executor and API key calls without actor infoType of Change
Testing
Tested manually
Checklist