diff options
author | Kegan Dougal <kegan@matrix.org> | 2015-10-20 11:07:50 +0100 |
---|---|---|
committer | Kegan Dougal <kegan@matrix.org> | 2015-10-20 11:07:50 +0100 |
commit | b02a342750f84ffebb793aa5d3c80780684dd147 (patch) | |
tree | bf7ab34b8518bdb3c85bcc73f4d9bffc8a3a25a0 /synapse/rest/client/v1/login.py | |
parent | Merge pull request #315 from matrix-org/paul/test-vectors (diff) | |
download | synapse-b02a342750f84ffebb793aa5d3c80780684dd147.tar.xz |
Don't 500 when the email doesn't map to a valid user ID.
Diffstat (limited to 'synapse/rest/client/v1/login.py')
-rw-r--r-- | synapse/rest/client/v1/login.py | 4 |
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'] |