Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #5574 from matrix-org/babolivier/fix-3pid-bind
Browse files Browse the repository at this point in the history
Fix new 3PID bindings being associated with rewritten IS's server names instead of the original one
  • Loading branch information
babolivier authored Jun 27, 2019
2 parents fbc5b58 + 1ef3627 commit f370fd0
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions synapse/handlers/identity.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,19 @@ def bind_threepid(self, creds, mxid):
client_secret = creds['clientSecret']
else:
raise SynapseError(400, "No client_secret in creds")

# if we have a rewrite rule set for the identity server,
# apply it now.
# apply it now, but only for sending the request (not
# storing in the database).
if id_server in self.rewrite_identity_server_urls:
id_server = self.rewrite_identity_server_urls[id_server]
id_server_host = self.rewrite_identity_server_urls[id_server]
else:
id_server_host = id_server

try:
data = yield self.http_client.post_urlencoded_get_json(
"https://%s%s" % (
id_server, "/_matrix/identity/api/v1/3pid/bind"
id_server_host, "/_matrix/identity/api/v1/3pid/bind"
),
{
'sid': creds['sid'],
Expand Down

0 comments on commit f370fd0

Please sign in to comment.