Skip to content

Commit

Permalink
Merge pull request #303 from matrix-org/babolivier/next_link
Browse files Browse the repository at this point in the history
Use get_args to get next link
  • Loading branch information
babolivier authored Jun 19, 2020
2 parents de80990 + 0055760 commit cf4040b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.d/303.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a bug causing Sydent to ignore `nextLink` parameters.
6 changes: 4 additions & 2 deletions sydent/http/servlets/emailservlet.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,17 @@ def __init__(self, syd):
self.sydent = syd

def render_GET(self, request):
args = get_args(request, ('nextLink',), required=False)

resp = None
try:
resp = self.do_validate_request(request)
except:
pass
if resp and 'success' in resp and resp['success']:
msg = "Verification successful! Please return to your Matrix client to continue."
if 'nextLink' in request.args:
next_link = request.args['nextLink'][0]
if 'nextLink' in args:
next_link = args['nextLink']
if not next_link.startswith("file:///"):
request.setResponseCode(302)
request.setHeader("Location", next_link)
Expand Down

0 comments on commit cf4040b

Please sign in to comment.