mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Ensure a user's identities are deleted when user is deleted
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user