summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2020-08-28 15:17:30 +0100
committerAndrew Morgan <andrew@amorgan.xyz>2020-08-28 15:17:30 +0100
commit1b4458ed26cc02bae741175558ca238473333dde (patch)
tree15bd8875f64e85733df065507771c4006ffa866c
parentPull things from, instead of copying the entirety of, the config (diff)
downloadsynapse-1b4458ed26cc02bae741175558ca238473333dde.tar.xz
Return 400 when accessing submit_token/_confirm with REMOTE behaviour
-rw-r--r--synapse/rest/client/v2_alpha/account.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/synapse/rest/client/v2_alpha/account.py b/synapse/rest/client/v2_alpha/account.py
index 746f34153a..a309cf532d 100644
--- a/synapse/rest/client/v2_alpha/account.py
+++ b/synapse/rest/client/v2_alpha/account.py
@@ -185,6 +185,11 @@ class PasswordResetSubmitTokenServlet(RestServlet):
             raise SynapseError(
                 400, "Email-based password resets are disabled on this server"
             )
+        elif self._threepid_behaviour_email == ThreepidBehaviour.REMOTE:
+            raise SynapseError(
+                400,
+                "Password resets for this homeserver are handled by a separate program",
+            )
 
         sid = parse_string(request, "sid", required=True)
         token = parse_string(request, "token", required=True)
@@ -244,6 +249,11 @@ class PasswordResetConfirmationSubmitTokenServlet(RestServlet):
             raise SynapseError(
                 400, "Email-based password resets are disabled on this server"
             )
+        elif self._threepid_behaviour_email == ThreepidBehaviour.REMOTE:
+            raise SynapseError(
+                400,
+                "Password resets for this homeserver are handled by a separate program",
+            )
 
         sid = parse_string(request, "sid", required=True)
         token = parse_string(request, "token", required=True)