[PM-32260] Fix missing device approval event logs for accepted users#7247
Open
[PM-32260] Fix missing device approval event logs for accepted users#7247
Conversation
…tions. Updated LogUserEventAsync method to include a new parameter for including organizations where the user has accepted status. Added corresponding unit tests to verify functionality.
… user event logging. Adjusted LogUserEventAsync method and corresponding unit tests to reflect the new parameter.
Contributor
|
Great job! No new security vulnerabilities introduced in this pull request |
JimmyVo16
approved these changes
Mar 18, 2026
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.

🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-32260
📔 Objective
Device approval requests (Event 1010) were not appearing in organization audit logs or triggering webhooks.
The root cause is that
LogUserEventAsyncresolves organization memberships from JWT claims, which only contain organizations where the user isConfirmed. Users inAcceptedstatus -- the typical state when requesting device approval -- had no org claims, so the event was created as a user-level event only, with no organization-scoped copy.This adds an
includeAcceptedStatusOrgsparameter toLogUserEventAsyncthat resolves memberships including Accepted status, and the device approval flow now opts in.