Ensure a user's identities are deleted when user is deleted
This commit is contained in:
parent
a235024268
commit
43d5c96f7d
|
@ -366,6 +366,7 @@ class DeletesV1 extends Worker
|
|||
protected function deleteUser(Document $document, string $projectId): void
|
||||
{
|
||||
$userId = $document->getId();
|
||||
$userInternalId = $document->getInternalId();
|
||||
|
||||
// Delete all sessions of this user from the sessions table and update the sessions field of the user record
|
||||
$this->deleteByGroup('sessions', [
|
||||
|
@ -399,6 +400,11 @@ class DeletesV1 extends Worker
|
|||
$this->deleteByGroup('tokens', [
|
||||
Query::equal('userId', [$userId])
|
||||
], $this->getProjectDB($projectId));
|
||||
|
||||
// Delete identities
|
||||
$this->deleteByGroup('identities', [
|
||||
Query::equal('userInternalId', [$userInternalId])
|
||||
], $this->getProjectDB($projectId));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue