summary refs log tree commit diff
path: root/synapse/handlers/auth.py
diff options
context:
space:
mode:
authorDavid Baker <dave@matrix.org>2015-04-17 19:53:47 +0100
committerDavid Baker <dave@matrix.org>2015-04-17 19:53:47 +0100
commit8db6832db8a8ad1a68ff6781b90f3e2cb1a72fc0 (patch)
tree61e65d287b349cf314042db86350e7cea421addb /synapse/handlers/auth.py
parentAdd endpoint to get threepids from server (diff)
downloadsynapse-8db6832db8a8ad1a68ff6781b90f3e2cb1a72fc0.tar.xz
Password reset, finally.
Diffstat (limited to '')
-rw-r--r--synapse/handlers/auth.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/synapse/handlers/auth.py b/synapse/handlers/auth.py
index 1f927e67ad..7b0ab4829b 100644
--- a/synapse/handlers/auth.py
+++ b/synapse/handlers/auth.py
@@ -195,12 +195,18 @@ class AuthHandler(BaseHandler):
     def _check_email_identity(self, authdict, _):
         yield run_on_reactor()
 
+        if 'threepidCreds' not in authdict:
+            raise LoginError(400, "Missing threepidCreds", Codes.MISSING_PARAM)
+
         threepidCreds = authdict['threepidCreds']
         identity_handler = self.hs.get_handlers().identity_handler
 
-        logger.debug("Getting validated threepid. threepidcreds: %r" % (threepidCreds,))
+        logger.info("Getting validated threepid. threepidcreds: %r" % (threepidCreds,))
         threepid = yield identity_handler.threepid_from_creds(threepidCreds)
 
+        if not threepid:
+            raise LoginError(401, "", errcode=Codes.UNAUTHORIZED)
+
         threepid['threepidCreds'] = authdict['threepidCreds']
 
         defer.returnValue(threepid)