summary refs log tree commit diff
path: root/synapse/rest/client
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-08-21 11:34:43 +0100
committerErik Johnston <erik@matrix.org>2015-08-21 11:38:44 +0100
commit42f12ad92f5bc372569f15ffc81e9cf8146d2ac6 (patch)
tree5b9e4d484c7a3e0110c8fafeed2428fb00a20b8b /synapse/rest/client
parentDon't allow people to register user ids which only differ by case to an exist... (diff)
downloadsynapse-42f12ad92f5bc372569f15ffc81e9cf8146d2ac6.tar.xz
When logging in fetch user by user_id case insensitively, *unless* there are multiple case insensitive matches, in which case require the exact user_id
Diffstat (limited to 'synapse/rest/client')
-rw-r--r--synapse/rest/client/v1/login.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/synapse/rest/client/v1/login.py b/synapse/rest/client/v1/login.py
index 0d5eafd0fa..2444f27366 100644
--- a/synapse/rest/client/v1/login.py
+++ b/synapse/rest/client/v1/login.py
@@ -83,9 +83,10 @@ class LoginRestServlet(ClientV1RestServlet):
 
         if not user_id.startswith('@'):
             user_id = UserID.create(
-                user_id, self.hs.hostname).to_string()
+                user_id, self.hs.hostname
+            ).to_string()
 
-        token = yield self.handlers.auth_handler.login_with_password(
+        user_id, token = yield self.handlers.auth_handler.login_with_password(
             user_id=user_id,
             password=login_submission["password"])