1
0
Fork 0
mirror of synced 2024-10-03 19:53:33 +13:00

Update Appwrite to save internal id as audit user id

It's important to use userInternalId so that if a user is recreated
with the same ID, lookups for the user will not return the data
of the old deleted user.

We will still store userId in data so that it can be pulled out and
returned for the log API calls.
This commit is contained in:
Steven Nguyen 2023-07-12 10:18:34 -07:00
parent fcd1be6726
commit f5a3a8f339
No known key found for this signature in database

View file

@ -40,8 +40,7 @@ class AuditsV1 extends Worker
$dbForProject = $this->getProjectDB($project->getId());
$audit = new Audit($dbForProject);
$audit->log(
userInternalId: $user->getInternalId(),
userId: $user->getId(),
userId: $user->getInternalId(),
// Pass first, most verbose event pattern
event: $event,
resource: $resource,
@ -49,6 +48,7 @@ class AuditsV1 extends Worker
ip: $ip,
location: '',
data: [
'userId' => $user->getId(),
'userName' => $userName,
'userEmail' => $userEmail,
'mode' => $mode,