Skip to content

Commit e59b059

Browse files
fix(web): add audit trail to GET /api/ee/user handler
Co-authored-by: Michael Sukkarieh <msukkari@users.noreply.github.com>
1 parent 6a86608 commit e59b059

File tree

1 file changed

+13
-0
lines changed
  • packages/web/src/app/api/(server)/ee/user

1 file changed

+13
-0
lines changed

packages/web/src/app/api/(server)/ee/user/route.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,19 @@ export const GET = apiHandler(async () => {
3434
return notFound('User not found');
3535
}
3636

37+
await auditService.createAudit({
38+
action: "user.read",
39+
actor: {
40+
id: user.id,
41+
type: "user"
42+
},
43+
target: {
44+
id: user.id,
45+
type: "user"
46+
},
47+
orgId: org.id,
48+
});
49+
3750
return userData;
3851
} catch (error) {
3952
logger.error('Error fetching user info', { error, userId: user.id });

0 commit comments

Comments
 (0)