Skip to content

Commit

Permalink
Remove auth provider external id association when deactivating an acc…
Browse files Browse the repository at this point in the history
…ount
  • Loading branch information
MatMaul committed Feb 29, 2024
1 parent 1177588 commit d8e2010
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions synapse/handlers/deactivate_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ async def deactivate_account(
# Remove account data (including ignored users and push rules).
await self.store.purge_account_data_for_user(user_id)

await self.store.remove_external_ids_by_user(user_id)

# Delete any server-side backup keys
await self.store.bulk_delete_backup_keys_and_versions_for_user(user_id)

Expand Down
9 changes: 9 additions & 0 deletions synapse/storage/databases/main/registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,15 @@ async def remove_user_external_id(
desc="remove_user_external_id",
)

async def remove_external_ids_by_user(self, mxid: str) -> None:
await self.db_pool.simple_delete(
table="user_external_ids",
keyvalues={
"user_id": mxid,
},
desc="remove_external_ids_by_user",
)

async def replace_user_external_id(
self,
record_external_ids: List[Tuple[str, str]],
Expand Down

0 comments on commit d8e2010

Please sign in to comment.