diff --git a/changelog.d/303.bugfix b/changelog.d/303.bugfix new file mode 100644 index 00000000..46a9d777 --- /dev/null +++ b/changelog.d/303.bugfix @@ -0,0 +1 @@ +Fix a bug causing Sydent to ignore `nextLink` parameters. diff --git a/sydent/http/servlets/emailservlet.py b/sydent/http/servlets/emailservlet.py index cf50468d..2abb4eec 100644 --- a/sydent/http/servlets/emailservlet.py +++ b/sydent/http/servlets/emailservlet.py @@ -88,6 +88,8 @@ 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) @@ -95,8 +97,8 @@ def render_GET(self, request): 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)