mirror of
				https://github.com/zulip/zulip.git
				synced 2025-10-31 03:53:50 +00:00 
			
		
		
		
	auth: show _OR_ during login only when other methods are available.
There might be good reasons to have other external authentication methods such as SAML configured, but none of them is available. This happens, for example, when you have enabled SAML so that Zulip is able to generate the metadata in XML format, but you haven't configured an IdP yet. This commit makes sure that the phrase _OR_ is only shown on the login/account page when there are actually other authentication methods available. When they are just configured, but not available yet, the page looks like as if no external authentication methods are be configured. We achieve this by deleting any_social_backend_enabled, which was very similar to page_params.external_authentication_methods, which correctly has one entry per configured SAML IdP.
This commit is contained in:
		| @@ -23,7 +23,6 @@ from zerver.lib.subdomains import get_subdomain | ||||
| from zerver.models import Realm, UserProfile, get_realm | ||||
| from zproject.backends import ( | ||||
|     AUTH_BACKEND_NAME_MAP, | ||||
|     any_social_backend_enabled, | ||||
|     auth_enabled_helper, | ||||
|     get_external_method_dicts, | ||||
|     password_auth_enabled, | ||||
| @@ -198,7 +197,6 @@ def login_context(request: HttpRequest) -> Dict[str, Any]: | ||||
|         "realm_description": realm_description, | ||||
|         "require_email_format_usernames": require_email_format_usernames(realm), | ||||
|         "password_auth_enabled": password_auth_enabled(realm), | ||||
|         "any_social_backend_enabled": any_social_backend_enabled(realm), | ||||
|         "two_factor_authentication_enabled": settings.TWO_FACTOR_AUTHENTICATION_ENABLED, | ||||
|     } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user