Skip to content
Snippets Groups Projects
Commit 2030193e authored by Andrew Morgan's avatar Andrew Morgan Committed by Andrew Morgan
Browse files

Remove local threepids on account deactivation (#6426)

parent 9b9ee756
No related branches found
No related tags found
No related merge requests found
Clean up local threepids from user on account deactivation.
\ No newline at end of file
...@@ -95,6 +95,9 @@ class DeactivateAccountHandler(BaseHandler): ...@@ -95,6 +95,9 @@ class DeactivateAccountHandler(BaseHandler):
user_id, threepid["medium"], threepid["address"] user_id, threepid["medium"], threepid["address"]
) )
# Remove all 3PIDs this user has bound to the homeserver
yield self.store.user_delete_threepids(user_id)
# delete any devices belonging to the user, which will also # delete any devices belonging to the user, which will also
# delete corresponding access tokens. # delete corresponding access tokens.
yield self._device_handler.delete_all_devices_for_user(user_id) yield self._device_handler.delete_all_devices_for_user(user_id)
......
...@@ -577,6 +577,19 @@ class RegistrationWorkerStore(SQLBaseStore): ...@@ -577,6 +577,19 @@ class RegistrationWorkerStore(SQLBaseStore):
return self._simple_delete( return self._simple_delete(
"user_threepids", "user_threepids",
keyvalues={"user_id": user_id, "medium": medium, "address": address}, keyvalues={"user_id": user_id, "medium": medium, "address": address},
desc="user_delete_threepid",
)
def user_delete_threepids(self, user_id: str):
"""Delete all threepid this user has bound
Args:
user_id: The user id to delete all threepids of
"""
return self._simple_delete(
"user_threepids",
keyvalues={"user_id": user_id},
desc="user_delete_threepids", desc="user_delete_threepids",
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment