Be consistent when associating keys with login types for registration/login.

This commit is contained in:
Kegan Dougal 2014-09-15 15:38:29 +01:00
parent 14bc4ed59f
commit 2c00e1ecd9
4 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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(

View File

@ -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"
}))

View File

@ -100,7 +100,7 @@ angular.module('matrixService', [])
}
else if (loginType === "m.login.password") {
data = {
user_id: userName,
user: userName,
password: password
};
}