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

Commit

Permalink
Remove POST method instead
Browse files Browse the repository at this point in the history
  • Loading branch information
anoadragon453 committed Sep 18, 2019
1 parent e55c127 commit ea93a21
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 23 deletions.
2 changes: 1 addition & 1 deletion changelog.d/6056.bugfix
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Fix broken call to `validate_threepid_session` during POST requests for password reset.
Remove POST method for all submit_token endpoints until we implement submit_url functionality.
22 changes: 0 additions & 22 deletions synapse/rest/client/v2_alpha/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,28 +272,6 @@ def on_GET(self, request, medium):
request.write(html.encode("utf-8"))
finish_request(request)

@defer.inlineCallbacks
def on_POST(self, request, medium):
if medium != "email":
raise SynapseError(
400, "This medium is currently not supported for password resets"
)

body = parse_json_object_from_request(request)
assert_params_in_dict(body, ["sid", "client_secret", "token"])

try:
yield self.store.validate_threepid_session(
body["sid"],
body["client_secret"],
body["token"],
self.clock.time_msec(),
)
return 200, {"success": True}
except ThreepidValidationError:
# Validation failure
return 400, {"success": False}


class PasswordRestServlet(RestServlet):
PATTERNS = client_patterns("/account/password$")
Expand Down

0 comments on commit ea93a21

Please sign in to comment.