summary refs log tree commit diff
path: root/synapse/handlers/identity.py
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2019-09-24 17:03:50 +0100
committerRichard van der Hoff <richard@matrix.org>2019-09-24 17:03:50 +0100
commit9b7c4f40782b09000141d7311fc39d387336350a (patch)
tree0c64c6ace7581c2f4e83c6b79159a11d35fc20e1 /synapse/handlers/identity.py
parentMerge remote-tracking branch 'origin/develop' into rav/saml_mapping_work (diff)
parentremove unused parameter to get_user_id_by_threepid (#6099) (diff)
downloadsynapse-9b7c4f40782b09000141d7311fc39d387336350a.tar.xz
Merge remote-tracking branch 'origin/develop' into rav/saml_mapping_work
Diffstat (limited to 'synapse/handlers/identity.py')
-rw-r--r--synapse/handlers/identity.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/synapse/handlers/identity.py b/synapse/handlers/identity.py
index 1f16afd14e..6d42a1aed8 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
 
@@ -328,6 +329,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)