auth: Rename any_oauth_backend_enabled to any_social_backend_enabled.

any_oauth_backend_enabled is all about whether we will have extra
buttons on the login/register pages for logging in with some non-native
backends (like Github, Google etc.). And this isn't about specifically
oauth backends, but generally "social" backends - that may not rely
specifically rely on Oauth. This will have more concrete relevance when
SAML authentication is added - which will be a "social" backend,
requiring an additional button, but not Oauth-based.
This commit is contained in:
Mateusz Mandera 2019-09-19 03:19:45 +02:00 committed by Tim Abbott
parent 050f814e47
commit 935702b6ec
4 changed files with 5 additions and 5 deletions

View File

@ -68,7 +68,7 @@ page can be easily identified in it's respective JavaScript file -->
<button class="full-width" type="submit">{{ _('Sign up') }}</button>
</form>
{% if any_oauth_backend_enabled %}
{% if any_social_backend_enabled %}
<div class="or"><span>{{ _('OR') }}</span></div>
{% endif %}
{% endif %}

View File

@ -124,7 +124,7 @@ page can be easily identified in it's respective JavaScript file. -->
</button>
</form>
{% if any_oauth_backend_enabled %}
{% if any_social_backend_enabled %}
<div class="or"><span>{{ _('OR') }}</span></div>
{% endif %}

View File

@ -7,7 +7,7 @@ from django.urls import reverse
from zerver.models import UserProfile, get_realm, Realm
from zproject.backends import (
any_oauth_backend_enabled,
any_social_backend_enabled,
password_auth_enabled,
require_email_format_usernames,
auth_enabled_helper,
@ -158,7 +158,7 @@ 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_oauth_backend_enabled': any_oauth_backend_enabled(realm),
'any_social_backend_enabled': any_social_backend_enabled(realm),
'two_factor_authentication_enabled': settings.TWO_FACTOR_AUTHENTICATION_ENABLED,
} # type: Dict[str, Any]

View File

@ -96,7 +96,7 @@ def google_auth_enabled(realm: Optional[Realm]=None) -> bool:
def github_auth_enabled(realm: Optional[Realm]=None) -> bool:
return auth_enabled_helper(['GitHub'], realm)
def any_oauth_backend_enabled(realm: Optional[Realm]=None) -> bool:
def any_social_backend_enabled(realm: Optional[Realm]=None) -> bool:
"""Used by the login page process to determine whether to show the
'OR' for login with Google"""
social_backend_names = [social_auth_subclass.auth_backend_name