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

Commit

Permalink
Add sid to next_link for email validation (#6097)
Browse files Browse the repository at this point in the history
  • Loading branch information
anoadragon453 committed Feb 25, 2020
2 parents cb063ad + 40fb00f commit c1dad64
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog.d/6097.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add sid to next_link for email validation.
10 changes: 10 additions & 0 deletions synapse/handlers/identity.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -368,6 +369,15 @@ def send_threepid_validation(
# 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)

Expand Down

0 comments on commit c1dad64

Please sign in to comment.