mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-14 07:05:28 -04:00
Dummy login so we can do the first POST request to get login flows without it just succeeding
This commit is contained in:
parent
a19b739909
commit
766bd8e880
4 changed files with 24 additions and 7 deletions
|
@ -63,6 +63,17 @@ class RegisterRestServlet(RestServlet):
|
|||
if 'access_token' in request.args:
|
||||
service = yield self.auth.get_appservice_by_req(request)
|
||||
|
||||
if self.hs.config.enable_registration_captcha:
|
||||
flows = [
|
||||
[LoginType.RECAPTCHA],
|
||||
[LoginType.EMAIL_IDENTITY, LoginType.RECAPTCHA]
|
||||
]
|
||||
else:
|
||||
flows = [
|
||||
[LoginType.DUMMY],
|
||||
[LoginType.EMAIL_IDENTITY]
|
||||
]
|
||||
|
||||
if service:
|
||||
is_application_server = True
|
||||
elif 'mac' in body:
|
||||
|
@ -74,10 +85,9 @@ class RegisterRestServlet(RestServlet):
|
|||
)
|
||||
is_using_shared_secret = True
|
||||
else:
|
||||
authed, result, params = yield self.auth_handler.check_auth([
|
||||
[LoginType.RECAPTCHA],
|
||||
[LoginType.EMAIL_IDENTITY, LoginType.RECAPTCHA],
|
||||
], body, self.hs.get_ip_from_request(request))
|
||||
authed, result, params = yield self.auth_handler.check_auth(
|
||||
flows, body, self.hs.get_ip_from_request(request)
|
||||
)
|
||||
|
||||
if not authed:
|
||||
defer.returnValue((401, result))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue