mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-29 07:28:55 +03:00
Be consistent when associating keys with login types for registration/login.
This commit is contained in:
parent
14bc4ed59f
commit
2c00e1ecd9
4 changed files with 4 additions and 4 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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"
|
||||
}))
|
||||
|
|
|
@ -100,7 +100,7 @@ angular.module('matrixService', [])
|
|||
}
|
||||
else if (loginType === "m.login.password") {
|
||||
data = {
|
||||
user_id: userName,
|
||||
user: userName,
|
||||
password: password
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue