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:
parent
fcd1be6726
commit
f5a3a8f339
1 changed files with 2 additions and 2 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue