summary refs log tree commit diff
path: root/synapse/rest/client/v2_alpha/register.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2021-01-28 17:39:21 +0000
committerGitHub <noreply@github.com>2021-01-28 17:39:21 +0000
commit4b73488e811714089ba447884dccb9b6ae3ac16c (patch)
tree2b6b6f17587e78d5d0e7cc4c0df84356f62f531a /synapse/rest/client/v2_alpha/register.py
parentCache config options in SSL verification (#9255) (diff)
downloadsynapse-4b73488e811714089ba447884dccb9b6ae3ac16c.tar.xz
Ratelimit 3PID /requestToken API (#9238)
Diffstat (limited to 'synapse/rest/client/v2_alpha/register.py')
-rw-r--r--synapse/rest/client/v2_alpha/register.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/synapse/rest/client/v2_alpha/register.py b/synapse/rest/client/v2_alpha/register.py
index b093183e79..10e1891174 100644
--- a/synapse/rest/client/v2_alpha/register.py
+++ b/synapse/rest/client/v2_alpha/register.py
@@ -126,6 +126,8 @@ class EmailRegisterRequestTokenRestServlet(RestServlet):
                 Codes.THREEPID_DENIED,
             )
 
+        self.identity_handler.ratelimit_request_token_requests(request, "email", email)
+
         existing_user_id = await self.hs.get_datastore().get_user_id_by_threepid(
             "email", email
         )
@@ -205,6 +207,10 @@ class MsisdnRegisterRequestTokenRestServlet(RestServlet):
                 Codes.THREEPID_DENIED,
             )
 
+        self.identity_handler.ratelimit_request_token_requests(
+            request, "msisdn", msisdn
+        )
+
         existing_user_id = await self.hs.get_datastore().get_user_id_by_threepid(
             "msisdn", msisdn
         )