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
35a25cc2a7
commit
58fa7546c1
1 changed files with 2 additions and 2 deletions
|
@ -40,8 +40,7 @@ class AuditsV1 extends Worker
|
||||||
$dbForProject = $this->getProjectDB($project->getId());
|
$dbForProject = $this->getProjectDB($project->getId());
|
||||||
$audit = new Audit($dbForProject);
|
$audit = new Audit($dbForProject);
|
||||||
$audit->log(
|
$audit->log(
|
||||||
userInternalId: $user->getInternalId(),
|
userId: $user->getInternalId(),
|
||||||
userId: $user->getId(),
|
|
||||||
// Pass first, most verbose event pattern
|
// Pass first, most verbose event pattern
|
||||||
event: $event,
|
event: $event,
|
||||||
resource: $resource,
|
resource: $resource,
|
||||||
|
@ -49,6 +48,7 @@ class AuditsV1 extends Worker
|
||||||
ip: $ip,
|
ip: $ip,
|
||||||
location: '',
|
location: '',
|
||||||
data: [
|
data: [
|
||||||
|
'userId' => $user->getId(),
|
||||||
'userName' => $userName,
|
'userName' => $userName,
|
||||||
'userEmail' => $userEmail,
|
'userEmail' => $userEmail,
|
||||||
'mode' => $mode,
|
'mode' => $mode,
|
||||||
|
|
Loading…
Reference in a new issue