summary refs log tree commit diff
path: root/synapse/rest/client/v1
diff options
context:
space:
mode:
authorKegan Dougal <kegan@matrix.org>2015-10-20 11:07:50 +0100
committerKegan Dougal <kegan@matrix.org>2015-10-20 11:07:50 +0100
commitb02a342750f84ffebb793aa5d3c80780684dd147 (patch)
treebf7ab34b8518bdb3c85bcc73f4d9bffc8a3a25a0 /synapse/rest/client/v1
parentMerge pull request #315 from matrix-org/paul/test-vectors (diff)
downloadsynapse-b02a342750f84ffebb793aa5d3c80780684dd147.tar.xz
Don't 500 when the email doesn't map to a valid user ID.
Diffstat (limited to 'synapse/rest/client/v1')
-rw-r--r--synapse/rest/client/v1/login.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/synapse/rest/client/v1/login.py b/synapse/rest/client/v1/login.py
index dacc416055..b2e4cb8eaa 100644
--- a/synapse/rest/client/v1/login.py
+++ b/synapse/rest/client/v1/login.py
@@ -101,6 +101,10 @@ class LoginRestServlet(ClientV1RestServlet):
             user_id = yield self.hs.get_datastore().get_user_id_by_threepid(
                 login_submission['medium'], login_submission['address']
             )
+            if not user_id:
+                raise LoginError(
+                    401, "Unrecognised address", errcode=Codes.UNAUTHORIZED
+                )
         else:
             user_id = login_submission['user']