summary refs log tree commit diff
diff options
context:
space:
mode:
authorKegan Dougal <kegan@matrix.org>2014-09-15 15:38:29 +0100
committerKegan Dougal <kegan@matrix.org>2014-09-15 15:38:29 +0100
commit2c00e1ecd9774463d687559d5df38b2a76340b32 (patch)
tree2da20ea3c6a7b030568244ec8d876f9389b601fb
parentMerge branch 'develop' of github.com:matrix-org/synapse into registration-api... (diff)
downloadsynapse-2c00e1ecd9774463d687559d5df38b2a76340b32.tar.xz
Be consistent when associating keys with login types for registration/login.
-rwxr-xr-xcmdclient/console.py2
-rw-r--r--synapse/rest/register.py2
-rw-r--r--tests/rest/utils.py2
-rw-r--r--webclient/components/matrix/matrix-service.js2
4 files changed, 4 insertions, 4 deletions
diff --git a/cmdclient/console.py b/cmdclient/console.py
index 5a9d4c3c4c..d9c6ec6a70 100755
--- a/cmdclient/console.py
+++ b/cmdclient/console.py
@@ -162,7 +162,7 @@ class SynapseCmd(cmd.Cmd):
             "type": "m.login.password"
         }
         if "userid" in args:
-            body["user_id"] = args["userid"]
+            body["user"] = args["userid"]
         if password:
             body["password"] = password
 
diff --git a/synapse/rest/register.py b/synapse/rest/register.py
index fe8f0ed23f..c2c80e70c7 100644
--- a/synapse/rest/register.py
+++ b/synapse/rest/register.py
@@ -192,7 +192,7 @@ class RegisterRestServlet(RestServlet):
             raise SynapseError(400, "Captcha is required.")
 
         password = register_json["password"].encode("utf-8")
-        desired_user_id = (register_json["user_id"].encode("utf-8") if "user_id"
+        desired_user_id = (register_json["user"].encode("utf-8") if "user"
                           in register_json else None)
         if desired_user_id and urllib.quote(desired_user_id) != desired_user_id:
             raise SynapseError(
diff --git a/tests/rest/utils.py b/tests/rest/utils.py
index 25ed1388cf..579441fb4a 100644
--- a/tests/rest/utils.py
+++ b/tests/rest/utils.py
@@ -99,7 +99,7 @@ class RestTestCase(unittest.TestCase):
             "POST",
             "/register",
             json.dumps({
-                "user_id": user_id,
+                "user": user_id,
                 "password": "test",
                 "type": "m.login.password"
             }))
diff --git a/webclient/components/matrix/matrix-service.js b/webclient/components/matrix/matrix-service.js
index 35ebca961c..069e02e939 100644
--- a/webclient/components/matrix/matrix-service.js
+++ b/webclient/components/matrix/matrix-service.js
@@ -100,7 +100,7 @@ angular.module('matrixService', [])
         }
         else if (loginType === "m.login.password") {
             data = {
-                user_id: userName,
+                user: userName,
                 password: password
             };
         }