mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2025-08-10 23:10:07 -04:00
Merge remote-tracking branch 'upstream/release-v1.32.0'
This commit is contained in:
commit
dbe12b3eb1
207 changed files with 4883 additions and 1550 deletions
|
@ -174,7 +174,7 @@ class RegistrationHandler(BaseHandler):
|
|||
user_type: Optional[str] = None,
|
||||
default_display_name: Optional[str] = None,
|
||||
address: Optional[str] = None,
|
||||
bind_emails: Iterable[str] = [],
|
||||
bind_emails: Optional[Iterable[str]] = None,
|
||||
by_admin: bool = False,
|
||||
user_agent_ips: Optional[List[Tuple[str, str]]] = None,
|
||||
auth_provider_id: Optional[str] = None,
|
||||
|
@ -209,7 +209,9 @@ class RegistrationHandler(BaseHandler):
|
|||
Raises:
|
||||
SynapseError if there was a problem registering.
|
||||
"""
|
||||
self.check_registration_ratelimit(address)
|
||||
bind_emails = bind_emails or []
|
||||
|
||||
await self.check_registration_ratelimit(address)
|
||||
|
||||
result = await self.spam_checker.check_registration_for_spam(
|
||||
threepid,
|
||||
|
@ -590,7 +592,7 @@ class RegistrationHandler(BaseHandler):
|
|||
errcode=Codes.EXCLUSIVE,
|
||||
)
|
||||
|
||||
def check_registration_ratelimit(self, address: Optional[str]) -> None:
|
||||
async def check_registration_ratelimit(self, address: Optional[str]) -> None:
|
||||
"""A simple helper method to check whether the registration rate limit has been hit
|
||||
for a given IP address
|
||||
|
||||
|
@ -604,7 +606,7 @@ class RegistrationHandler(BaseHandler):
|
|||
if not address:
|
||||
return
|
||||
|
||||
self.ratelimiter.ratelimit(address)
|
||||
await self.ratelimiter.ratelimit(None, address)
|
||||
|
||||
async def register_with_store(
|
||||
self,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue