mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-10-01 08:25:44 -04:00
Fix registration for broken clients
Only offer msisdn flows if the x_show_msisdn option is given.
This commit is contained in:
parent
73a5f06652
commit
0a9945220e
@ -236,19 +236,37 @@ class RegisterRestServlet(RestServlet):
|
|||||||
assigned_user_id=registered_user_id,
|
assigned_user_id=registered_user_id,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Only give msisdn flows if the x_show_msisdn flag is given:
|
||||||
|
# this is a hack to work around the fact that clients were shipped
|
||||||
|
# that use fallback registration if they see any flows that they don't
|
||||||
|
# recognise, which means we break registration for these clients if we
|
||||||
|
# advertise msisdn flows. Once usage of Riot iOS <=0.3.9 and Riot
|
||||||
|
# Android <=0.6.9 have fallen below an acceptable threshold, this
|
||||||
|
# parameter should go away and we should always advertise msisdn flows.
|
||||||
|
show_msisdn = False
|
||||||
|
print body
|
||||||
|
if 'x_show_msisdn' in body and body['x_show_msisdn']:
|
||||||
|
show_msisdn = True
|
||||||
|
|
||||||
if self.hs.config.enable_registration_captcha:
|
if self.hs.config.enable_registration_captcha:
|
||||||
flows = [
|
flows = [
|
||||||
[LoginType.RECAPTCHA],
|
[LoginType.RECAPTCHA],
|
||||||
[LoginType.EMAIL_IDENTITY, LoginType.RECAPTCHA],
|
[LoginType.EMAIL_IDENTITY, LoginType.RECAPTCHA],
|
||||||
|
]
|
||||||
|
if show_msisdn:
|
||||||
|
flows += [
|
||||||
[LoginType.MSISDN, LoginType.RECAPTCHA],
|
[LoginType.MSISDN, LoginType.RECAPTCHA],
|
||||||
[LoginType.EMAIL_IDENTITY, LoginType.MSISDN, LoginType.RECAPTCHA],
|
[LoginType.MSISDN, LoginType.EMAIL_IDENTITY, LoginType.RECAPTCHA],
|
||||||
]
|
]
|
||||||
else:
|
else:
|
||||||
flows = [
|
flows = [
|
||||||
[LoginType.DUMMY],
|
[LoginType.DUMMY],
|
||||||
[LoginType.EMAIL_IDENTITY],
|
[LoginType.EMAIL_IDENTITY],
|
||||||
|
]
|
||||||
|
if show_msisdn:
|
||||||
|
flows += [
|
||||||
[LoginType.MSISDN],
|
[LoginType.MSISDN],
|
||||||
[LoginType.EMAIL_IDENTITY, LoginType.MSISDN],
|
[LoginType.MSISDN, LoginType.EMAIL_IDENTITY],
|
||||||
]
|
]
|
||||||
|
|
||||||
authed, auth_result, params, session_id = yield self.auth_handler.check_auth(
|
authed, auth_result, params, session_id = yield self.auth_handler.check_auth(
|
||||||
|
Loading…
Reference in New Issue
Block a user