mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 13:33:24 +00:00
login: Make authentication_methods data available to JavaScript.
This is intended to simplify overriding these buttons' controls in the desktop app to do the authentication in the user's default browser.
This commit is contained in:
committed by
Tim Abbott
parent
b685d506ad
commit
6aacc4195e
@@ -178,6 +178,15 @@ def login_context(request: HttpRequest) -> Dict[str, Any]:
|
||||
context['external_authentication_methods'] = get_external_method_dicts(realm)
|
||||
context['no_auth_enabled'] = no_auth_enabled
|
||||
|
||||
# Include another copy of external_authentication_methods in page_params for use
|
||||
# by the desktop client. We expand it with IDs of the <button> elements corresponding
|
||||
# to the authentication methods.
|
||||
context['page_params'] = dict(
|
||||
external_authentication_methods = get_external_method_dicts(realm)
|
||||
)
|
||||
for auth_dict in context['page_params']['external_authentication_methods']:
|
||||
auth_dict['button_id_suffix'] = "auth_button_%s" % (auth_dict['name'],)
|
||||
|
||||
return context
|
||||
|
||||
def latest_info_context() -> Dict[str, str]:
|
||||
|
||||
Reference in New Issue
Block a user