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

Commit bd3a6f6

Browse files
committed
Remove POST method from password reset submit_token endpoint (#6056)
2 parents 3d05c29 + 62e3ff9 commit bd3a6f6

File tree

2 files changed

+1
-19
lines changed

2 files changed

+1
-19
lines changed

changelog.d/6056.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove POST method from password reset submit_token endpoint until we implement submit_url functionality.

synapse/rest/client/v2_alpha/account.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -282,25 +282,6 @@ def on_GET(self, request, medium):
282282
request.write(html.encode("utf-8"))
283283
finish_request(request)
284284

285-
@defer.inlineCallbacks
286-
def on_POST(self, request, medium):
287-
if medium != "email":
288-
raise SynapseError(
289-
400, "This medium is currently not supported for password resets"
290-
)
291-
292-
body = parse_json_object_from_request(request)
293-
assert_params_in_dict(body, ["sid", "client_secret", "token"])
294-
295-
assert_valid_client_secret(body["client_secret"])
296-
297-
valid, _ = yield self.store.validate_threepid_session(
298-
body["sid"], body["client_secret"], body["token"], self.clock.time_msec()
299-
)
300-
response_code = 200 if valid else 400
301-
302-
return response_code, {"success": valid}
303-
304285

305286
class PasswordRestServlet(RestServlet):
306287
PATTERNS = client_patterns("/account/password$")

0 commit comments

Comments
 (0)