diff --git a/sydent/http/servlets/emailservlet.py b/sydent/http/servlets/emailservlet.py index 1b6445ff..79173095 100644 --- a/sydent/http/servlets/emailservlet.py +++ b/sydent/http/servlets/emailservlet.py @@ -32,18 +32,18 @@ def __init__(self, syd): def render_POST(self, request): send_cors(request) - error = require_args(request, ('email', 'clientSecret', 'sendAttempt')) + error = require_args(request, ('email', 'client_secret', 'send_attempt')) if error: return error email = request.args['email'][0] - clientSecret = request.args['clientSecret'][0] - sendAttempt = request.args['sendAttempt'][0] + clientSecret = request.args['client_secret'][0] + sendAttempt = request.args['send_attempt'][0] ipaddress = self.sydent.ip_from_request(request) nextLink = None - if 'nextLink' in request.args: - nextLink = request.args['nextLink'][0] + if 'next_link' in request.args: + nextLink = request.args['next_link'][0] resp = None @@ -99,13 +99,13 @@ def render_POST(self, request): def do_validate_request(self, request): send_cors(request) - err = require_args(request, ('token', 'sid', 'clientSecret')) + err = require_args(request, ('token', 'sid', 'client_secret')) if err: return err sid = request.args['sid'][0] tokenString = request.args['token'][0] - clientSecret = request.args['clientSecret'][0] + clientSecret = request.args['client_secret'][0] try: resp = self.sydent.validators.email.validateSessionWithToken(sid, clientSecret, tokenString) diff --git a/sydent/http/servlets/getvalidated3pidservlet.py b/sydent/http/servlets/getvalidated3pidservlet.py index 63c968f8..e80c90e3 100644 --- a/sydent/http/servlets/getvalidated3pidservlet.py +++ b/sydent/http/servlets/getvalidated3pidservlet.py @@ -31,12 +31,12 @@ def __init__(self, syd): @jsonwrap def render_GET(self, request): - err = require_args(request, ('sid', 'clientSecret')) + err = require_args(request, ('sid', 'client_secret')) if err: return err sid = request.args['sid'][0] - clientSecret = request.args['clientSecret'][0] + clientSecret = request.args['client_secret'][0] valSessionStore = ThreePidValSessionStore(self.sydent) @@ -56,4 +56,4 @@ def render_GET(self, request): return {'errcode': 'M_SESSION_NOT_VALIDATED', 'error': "This validation session has not yet been completed"} - return { 'medium': s.medium, 'address': s.address, 'validatedAt': s.mtime } \ No newline at end of file + return { 'medium': s.medium, 'address': s.address, 'validated_at': s.mtime } \ No newline at end of file diff --git a/sydent/http/servlets/threepidbindservlet.py b/sydent/http/servlets/threepidbindservlet.py index dab8b308..ff8bcea2 100644 --- a/sydent/http/servlets/threepidbindservlet.py +++ b/sydent/http/servlets/threepidbindservlet.py @@ -27,12 +27,12 @@ def __init__(self, sydent): @jsonwrap def render_POST(self, request): send_cors(request) - err = require_args(request, ('sid', 'clientSecret', 'mxid')) + err = require_args(request, ('sid', 'client_secret', 'mxid')) if err: return err sid = request.args['sid'][0] - clientSecret = request.args['clientSecret'][0] + clientSecret = request.args['client_secret'][0] mxid = request.args['mxid'][0] # Return the same error for not found / bad client secret otherwise people can get information about diff --git a/sydent/validators/emailvalidator.py b/sydent/validators/emailvalidator.py index b1c74429..8bcc4a87 100644 --- a/sydent/validators/emailvalidator.py +++ b/sydent/validators/emailvalidator.py @@ -98,7 +98,7 @@ def requestToken(self, emailAddress, clientSecret, sendAttempt, nextLink, ipaddr def makeValidateLink(self, valSession, clientSecret, nextLink): base = self.sydent.cfg.get('http', 'client_http_base') - link = "%s/_matrix/identity/api/v1/validate/email/submitToken?token=%s&clientSecret=%s&sid=%d" % ( + link = "%s/_matrix/identity/api/v1/validate/email/submitToken?token=%s&client_secret=%s&sid=%d" % ( base, urllib.quote(valSession.token), urllib.quote(clientSecret),