summary refs log tree commit diff
path: root/synapse/rest/client/v2_alpha/account.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-07-14 10:00:38 +0100
committerErik Johnston <erik@matrix.org>2016-07-14 10:00:38 +0100
commitb55c7702717987aa7b50469b4f099fa3a29976d5 (patch)
treeac8bb9ba4d76c63889e297aeeff8d6b6960d3981 /synapse/rest/client/v2_alpha/account.py
parentAdd an /account/deactivate endpoint (diff)
downloadsynapse-b55c7702717987aa7b50469b4f099fa3a29976d5.tar.xz
Only accept password auth
Diffstat (limited to 'synapse/rest/client/v2_alpha/account.py')
-rw-r--r--synapse/rest/client/v2_alpha/account.py12
1 files changed, 0 insertions, 12 deletions
diff --git a/synapse/rest/client/v2_alpha/account.py b/synapse/rest/client/v2_alpha/account.py
index d0412122a7..366f1ec158 100644
--- a/synapse/rest/client/v2_alpha/account.py
+++ b/synapse/rest/client/v2_alpha/account.py
@@ -136,7 +136,6 @@ class DeactivateAccountRestServlet(RestServlet):
 
         authed, result, params, _ = yield self.auth_handler.check_auth([
             [LoginType.PASSWORD],
-            [LoginType.EMAIL_IDENTITY]
         ], body, self.hs.get_ip_from_request(request))
 
         if not authed:
@@ -151,17 +150,6 @@ class DeactivateAccountRestServlet(RestServlet):
             user_id = requester.user.to_string()
             if user_id != result[LoginType.PASSWORD]:
                 raise LoginError(400, "", Codes.UNKNOWN)
-        elif LoginType.EMAIL_IDENTITY in result:
-            threepid = result[LoginType.EMAIL_IDENTITY]
-            if 'medium' not in threepid or 'address' not in threepid:
-                raise SynapseError(500, "Malformed threepid")
-            # if using email, we must know about the email they're authing with!
-            threepid_user_id = yield self.hs.get_datastore().get_user_id_by_threepid(
-                threepid['medium'], threepid['address']
-            )
-            if not threepid_user_id:
-                raise SynapseError(404, "Email address not found", Codes.NOT_FOUND)
-            user_id = threepid_user_id
         else:
             logger.error("Auth succeeded but no known type!", result.keys())
             raise SynapseError(500, "", Codes.UNKNOWN)