You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(web): add audit log entries for org membership changes (#1165)
* feat(web): add audit log entries for org membership changes
Adds three new audit actions covering the full membership lifecycle:
- org.member_added — fires from all five UserToOrg-creation paths
(initial owner, auto-add on signup, magic invite-link join, email
invite redemption, join-request approval). Two of those paths were
previously silent.
- org.member_removed — fires when an admin removes a member via the
Settings UI.
- org.member_left — fires when a user leaves the org themselves.
Each event uses a consistent (actor=user, target=user) shape so the
membership history can be reconstructed with a single query per state
transition. Existing audits (user.invite_accepted,
user.join_request_approved, user.owner_created) are preserved as
semantic detail.
* chore: add changelog entry for #1165
* changelog
* fix(web): write approval audits before email side effect
Move user.join_request_approved and org.member_added audit writes to occur
immediately after addUserToOrganization() and before the email send. This
ensures the audit trail is complete even if render() or sendMail() throws.
Wrapped the email block in try/catch so email failures are logged without
propagating as errors.
Co-authored-by: Brendan Kellam <brendan-kellam@users.noreply.github.com>
---------
Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Brendan Kellam <brendan-kellam@users.noreply.github.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
8
8
## [Unreleased]
9
9
10
+
### Added
11
+
-[EE] Added three new audit actions covering the full org membership lifecycle: `org.member_added`, `org.member_removed`, and `org.member_left`. [#1165](https://github.com/sourcebot-dev/sourcebot/pull/1165)
0 commit comments