1
0

send access_tokens correctly

This commit is contained in:
Matthew Hodgson
2018-11-03 18:48:51 +00:00
parent 967b64bfbe
commit d839963a08
3 changed files with 12 additions and 17 deletions
+2 -2
View File
@@ -439,8 +439,8 @@ class RegistrationHandler(BaseHandler):
as_token = self.hs.config.shadow_server.get("as_token")
yield self.http_client.post_json_get_json(
"%s%s" % (
shadow_hs_url, "/_matrix/client/r0/register"
"%s/_matrix/client/r0/register?access_token=%s" % (
shadow_hs_url, as_token,
),
{
# XXX: auth_result is an unspecified extension for shadow registration
+4 -6
View File
@@ -73,11 +73,10 @@ class ProfileDisplaynameRestServlet(ClientV1RestServlet):
# TODO: retries
shadow_hs_url = self.hs.config.shadow_server.get("hs_url")
as_token = self.hs.config.shadow_server.get("as_token")
body['access_token'] = as_token
yield self.http_client.post_json_get_json(
"%s%s" % (
shadow_hs_url, ("/_matrix/client/r0/profile/%s/displayname" % user_id)
"%s/_matrix/client/r0/profile/%s/displayname?access_token=%s" % (
shadow_hs_url, user_id, as_token
),
body
)
@@ -133,11 +132,10 @@ class ProfileAvatarURLRestServlet(ClientV1RestServlet):
# TODO: retries
shadow_hs_url = self.hs.config.shadow_server.get("hs_url")
as_token = self.hs.config.shadow_server.get("as_token")
body['access_token'] = as_token
yield self.http_client.post_json_get_json(
"%s%s" % (
shadow_hs_url, ("/_matrix/client/r0/profile/%s/avatar_url" % user_id)
"%s/_matrix/client/r0/profile/%s/avatar_url?access_token=%s" % (
shadow_hs_url, user_id, as_token
),
body
)
+6 -9
View File
@@ -191,11 +191,10 @@ class PasswordRestServlet(RestServlet):
# TODO: retries
shadow_hs_url = self.hs.config.shadow_server.get("hs_url")
as_token = self.hs.config.shadow_server.get("as_token")
body['access_token'] = as_token
yield self.http_client.post_json_get_json(
"%s%s" % (
shadow_hs_url, "/_matrix/client/r0/account/password"
"%s/_matrix/client/r0/account/password?access_token=%s" % (
shadow_hs_url, as_token
),
body
)
@@ -403,11 +402,10 @@ class ThreepidRestServlet(RestServlet):
# TODO: retries
shadow_hs_url = self.hs.config.shadow_server.get("hs_url")
as_token = self.hs.config.shadow_server.get("as_token")
body['access_token'] = as_token
yield self.http_client.post_json_get_json(
"%s%s" % (
shadow_hs_url, "/_matrix/client/r0/account/3pid"
"%s/_matrix/client/r0/account/3pid?access_token=%s" % (
shadow_hs_url, as_token
),
body
)
@@ -462,11 +460,10 @@ class ThreepidDeleteRestServlet(RestServlet):
# TODO: retries
shadow_hs_url = self.hs.config.shadow_server.get("hs_url")
as_token = self.hs.config.shadow_server.get("as_token")
body['access_token'] = as_token
yield self.http_client.post_json_get_json(
"%s%s" % (
shadow_hs_url, "/_matrix/client/r0/account/3pid/delete"
"%s/_matrix/client/r0/account/3pid/delete?access_token=%s" % (
shadow_hs_url, as_token
),
body
)