summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorreivilibre <oliverw@matrix.org>2022-08-19 11:03:29 +0000
committerGitHub <noreply@github.com>2022-08-19 11:03:29 +0000
commit3a245f6cfe3f35f5a37bcd91f3242ef59dc71332 (patch)
treeb047c97f35c54a9d2569fa99ae5ff31172891334 /tests
parentAdd metrics to track `/messages` response time by room size (#13545) (diff)
downloadsynapse-3a245f6cfe3f35f5a37bcd91f3242ef59dc71332.tar.xz
Fix validation problem that occurs when a user tries to deactivate their account or change their password. (#13563)
Diffstat (limited to 'tests')
-rw-r--r--tests/handlers/test_deactivate_account.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/handlers/test_deactivate_account.py b/tests/handlers/test_deactivate_account.py
index 82baa8f154..7b9b711521 100644
--- a/tests/handlers/test_deactivate_account.py
+++ b/tests/handlers/test_deactivate_account.py
@@ -322,3 +322,18 @@ class DeactivateAccountTestCase(HomeserverTestCase):
                 )
             ),
         )
+
+    def test_deactivate_account_needs_auth(self) -> None:
+        """
+        Tests that making a request to /deactivate with an empty body
+        succeeds in starting the user-interactive auth flow.
+        """
+        req = self.make_request(
+            "POST",
+            "account/deactivate",
+            {},
+            access_token=self.token,
+        )
+
+        self.assertEqual(req.code, 401, req)
+        self.assertEqual(req.json_body["flows"], [{"stages": ["m.login.password"]}])