mirror of
https://mau.dev/maunium/synapse.git
synced 2024-10-01 01:36:05 -04:00
add yields
This commit is contained in:
parent
e446077478
commit
82c4fd7226
@ -308,7 +308,7 @@ class RegistrationHandler(BaseHandler):
|
|||||||
logger.info("got threepid with medium '%s' and address '%s'",
|
logger.info("got threepid with medium '%s' and address '%s'",
|
||||||
threepid['medium'], threepid['address'])
|
threepid['medium'], threepid['address'])
|
||||||
|
|
||||||
if not check_3pid_allowed(self.hs, threepid['medium'], threepid['address']):
|
if not (yield check_3pid_allowed(self.hs, threepid['medium'], threepid['address'])):
|
||||||
raise RegistrationError(
|
raise RegistrationError(
|
||||||
403, "Third party identifier is not allowed"
|
403, "Third party identifier is not allowed"
|
||||||
)
|
)
|
||||||
|
@ -48,7 +48,7 @@ class EmailPasswordRequestTokenRestServlet(RestServlet):
|
|||||||
'id_server', 'client_secret', 'email', 'send_attempt'
|
'id_server', 'client_secret', 'email', 'send_attempt'
|
||||||
])
|
])
|
||||||
|
|
||||||
if not check_3pid_allowed(self.hs, "email", body['email']):
|
if not (yield check_3pid_allowed(self.hs, "email", body['email'])):
|
||||||
raise SynapseError(
|
raise SynapseError(
|
||||||
403, "Third party identifier is not allowed", Codes.THREEPID_DENIED,
|
403, "Third party identifier is not allowed", Codes.THREEPID_DENIED,
|
||||||
)
|
)
|
||||||
@ -84,7 +84,7 @@ class MsisdnPasswordRequestTokenRestServlet(RestServlet):
|
|||||||
|
|
||||||
msisdn = phone_number_to_msisdn(body['country'], body['phone_number'])
|
msisdn = phone_number_to_msisdn(body['country'], body['phone_number'])
|
||||||
|
|
||||||
if not check_3pid_allowed(self.hs, "msisdn", msisdn):
|
if not (yield check_3pid_allowed(self.hs, "msisdn", msisdn)):
|
||||||
raise SynapseError(
|
raise SynapseError(
|
||||||
403, "Third party identifier is not allowed", Codes.THREEPID_DENIED,
|
403, "Third party identifier is not allowed", Codes.THREEPID_DENIED,
|
||||||
)
|
)
|
||||||
@ -228,7 +228,7 @@ class EmailThreepidRequestTokenRestServlet(RestServlet):
|
|||||||
if absent:
|
if absent:
|
||||||
raise SynapseError(400, "Missing params: %r" % absent, Codes.MISSING_PARAM)
|
raise SynapseError(400, "Missing params: %r" % absent, Codes.MISSING_PARAM)
|
||||||
|
|
||||||
if not check_3pid_allowed(self.hs, "email", body['email']):
|
if not (yield check_3pid_allowed(self.hs, "email", body['email'])):
|
||||||
raise SynapseError(
|
raise SynapseError(
|
||||||
403, "Third party identifier is not allowed", Codes.THREEPID_DENIED,
|
403, "Third party identifier is not allowed", Codes.THREEPID_DENIED,
|
||||||
)
|
)
|
||||||
@ -271,7 +271,7 @@ class MsisdnThreepidRequestTokenRestServlet(RestServlet):
|
|||||||
|
|
||||||
msisdn = phone_number_to_msisdn(body['country'], body['phone_number'])
|
msisdn = phone_number_to_msisdn(body['country'], body['phone_number'])
|
||||||
|
|
||||||
if not check_3pid_allowed(self.hs, "msisdn", msisdn):
|
if not (yield check_3pid_allowed(self.hs, "msisdn", msisdn)):
|
||||||
raise SynapseError(
|
raise SynapseError(
|
||||||
403, "Third party identifier is not allowed", Codes.THREEPID_DENIED,
|
403, "Third party identifier is not allowed", Codes.THREEPID_DENIED,
|
||||||
)
|
)
|
||||||
|
@ -71,7 +71,7 @@ class EmailRegisterRequestTokenRestServlet(RestServlet):
|
|||||||
'id_server', 'client_secret', 'email', 'send_attempt'
|
'id_server', 'client_secret', 'email', 'send_attempt'
|
||||||
])
|
])
|
||||||
|
|
||||||
if not check_3pid_allowed(self.hs, "email", body['email']):
|
if not (yield check_3pid_allowed(self.hs, "email", body['email'])):
|
||||||
raise SynapseError(
|
raise SynapseError(
|
||||||
403, "Third party identifier is not allowed", Codes.THREEPID_DENIED,
|
403, "Third party identifier is not allowed", Codes.THREEPID_DENIED,
|
||||||
)
|
)
|
||||||
@ -111,7 +111,7 @@ class MsisdnRegisterRequestTokenRestServlet(RestServlet):
|
|||||||
|
|
||||||
msisdn = phone_number_to_msisdn(body['country'], body['phone_number'])
|
msisdn = phone_number_to_msisdn(body['country'], body['phone_number'])
|
||||||
|
|
||||||
if not check_3pid_allowed(self.hs, "msisdn", msisdn):
|
if not (yield check_3pid_allowed(self.hs, "msisdn", msisdn)):
|
||||||
raise SynapseError(
|
raise SynapseError(
|
||||||
403, "Third party identifier is not allowed", Codes.THREEPID_DENIED,
|
403, "Third party identifier is not allowed", Codes.THREEPID_DENIED,
|
||||||
)
|
)
|
||||||
@ -371,7 +371,7 @@ class RegisterRestServlet(RestServlet):
|
|||||||
medium = auth_result[login_type]['medium']
|
medium = auth_result[login_type]['medium']
|
||||||
address = auth_result[login_type]['address']
|
address = auth_result[login_type]['address']
|
||||||
|
|
||||||
if not check_3pid_allowed(self.hs, medium, address):
|
if not (yield check_3pid_allowed(self.hs, medium, address)):
|
||||||
raise SynapseError(
|
raise SynapseError(
|
||||||
403, "Third party identifier is not allowed",
|
403, "Third party identifier is not allowed",
|
||||||
Codes.THREEPID_DENIED,
|
Codes.THREEPID_DENIED,
|
||||||
|
Loading…
Reference in New Issue
Block a user