1
0
Fork 0
mirror of synced 2024-07-03 13:41:01 +12: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 35a25cc2a7
commit 58fa7546c1
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,