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

Commit 62e3ff9

Browse files
Remove POST method from password reset submit_token endpoint (#6056)
Removes the POST method from `/password_reset/<medium>/submit_token/` as it's only used by phone number verification which Synapse does not support yet.
1 parent 38fd1f8 commit 62e3ff9

File tree

2 files changed

+1
-17
lines changed

2 files changed

+1
-17
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 & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -272,23 +272,6 @@ def on_GET(self, request, medium):
272272
request.write(html.encode("utf-8"))
273273
finish_request(request)
274274

275-
@defer.inlineCallbacks
276-
def on_POST(self, request, medium):
277-
if medium != "email":
278-
raise SynapseError(
279-
400, "This medium is currently not supported for password resets"
280-
)
281-
282-
body = parse_json_object_from_request(request)
283-
assert_params_in_dict(body, ["sid", "client_secret", "token"])
284-
285-
valid, _ = yield self.store.validate_threepid_session(
286-
body["sid"], body["client_secret"], body["token"], self.clock.time_msec()
287-
)
288-
response_code = 200 if valid else 400
289-
290-
return response_code, {"success": valid}
291-
292275

293276
class PasswordRestServlet(RestServlet):
294277
PATTERNS = client_patterns("/account/password$")

0 commit comments

Comments
 (0)