summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2020-02-25 17:46:48 +0000
committerAndrew Morgan <andrew@amorgan.xyz>2020-02-25 17:46:48 +0000
commitc1dad6483d8633b6f3ad91a66752784ee5564db4 (patch)
treef4111f7bf6e05afdd862c004b5279537634a8f6b
parentAdd submit_url response parameter to msisdn /requestToken (#6079) (diff)
parentAdd sid to next_link for email validation (#6097) (diff)
downloadsynapse-c1dad6483d8633b6f3ad91a66752784ee5564db4.tar.xz
Add sid to next_link for email validation (#6097)
-rw-r--r--changelog.d/6097.bugfix1
-rw-r--r--synapse/handlers/identity.py10
2 files changed, 11 insertions, 0 deletions
diff --git a/changelog.d/6097.bugfix b/changelog.d/6097.bugfix
new file mode 100644

index 0000000000..750a8ecf0a --- /dev/null +++ b/changelog.d/6097.bugfix
@@ -0,0 +1 @@ +Add sid to next_link for email validation. diff --git a/synapse/handlers/identity.py b/synapse/handlers/identity.py
index 3b62938a21..25e7961144 100644 --- a/synapse/handlers/identity.py +++ b/synapse/handlers/identity.py
@@ -18,6 +18,7 @@ """Utilities for interacting with Identity Servers""" import logging +import urllib from canonicaljson import json from signedjson.key import decode_verify_key_bytes @@ -368,6 +369,15 @@ class IdentityHandler(BaseHandler): # Generate a session id session_id = random_string(16) + if next_link: + # Manipulate the next_link to add the sid, because the caller won't get + # it until we send a response, by which time we've sent the mail. + if "?" in next_link: + next_link += "&" + else: + next_link += "?" + next_link += "sid=" + urllib.parse.quote(session_id) + # Generate a new validation token token = random_string(32)