Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Display social login only when it's enabled

Artur Smęt40f45a73f20c
diff --git a/saleor/settings.py b/saleor/settings.py
index 2fa3ff3c3a..aafb08954d 100644
--- a/saleor/settings.py
+++ b/saleor/settings.py
@@ -167,10 +167,7 @@ INSTALLED_APPS = [
'webpack_loader',
'allauth',
'allauth.account',
- 'allauth.socialaccount',
- 'allauth.socialaccount.providers.facebook',
- 'allauth.socialaccount.providers.github',
- 'allauth.socialaccount.providers.google',
+ 'allauth.socialaccount'
]
LOGGING = {
@@ -312,6 +309,5 @@ ACCOUNT_EMAIL_REQUIRED = True
ACCOUNT_USER_MODEL_USERNAME_FIELD = None
ACCOUNT_EMAIL_VERIFICATION = 'mandatory'
ACCOUNT_USERNAME_REQUIRED = False
-# ACCOUNT_ADAPTER = 'saleor.userprofile.account_adapter.SaleorAccountAdapter'
SOCIALACCOUNT_EMAIL_VERIFICATION = False
ACCOUNT_LOGOUT_ON_GET = True
diff --git a/templates/account/login.html b/templates/account/login.html
index 7b19800676..5f1166f074 100644
--- a/templates/account/login.html
+++ b/templates/account/login.html
@@ -26,14 +26,16 @@
{% trans "Sign in" %}
</button>
</div>
- <hr>
+ {% get_providers as socialaccount_providers %}
+ {% if socialaccount_providers %}
+ <hr>
<p>{% trans "Want to use your social profile?" %}</p>
<p>
- {% get_providers as socialaccount_providers %}
<a class="btn btn-default" href="{% provider_login_url "facebook" method="oauth2" %}">{% trans "Sign in using Facebook" %}</a>
<a class="btn btn-default" href="{% provider_login_url "google" %}">{% trans "Sign in using Google" %}</a>
</p>
- <hr>
+ {% endif %}
+ <hr>
<div class="form-group">
<p>{% trans "Don't have an account yet?" %} <a class="btn btn-secondary" href="{{ signup_url }}">{% trans "Sign up" %}</a></p>
</div>