Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Fix social media login settings
Pacu25b37d4890a59
diff --git a/saleor/account/models.py b/saleor/account/models.pyindex 24220ea26e..8ce004a94b 100644--- a/saleor/account/models.py+++ b/saleor/account/models.py@@ -75,6 +75,8 @@ class UserManager(BaseUserManager):**extra_fields):"""Create a user instance with the given email and password."""email = UserManager.normalize_email(email)+ # Google OAuth2 backend send unnecessary username field+ extra_fields.pop('username', None)user = self.model(email=email, is_active=is_active, is_staff=is_staff,**extra_fields)diff --git a/saleor/settings.py b/saleor/settings.pyindex f6c0250f96..761e77a5d3 100644--- a/saleor/settings.py+++ b/saleor/settings.py@@ -424,6 +424,8 @@ SOCIAL_AUTH_USER_MODEL = AUTH_USER_MODELSOCIAL_AUTH_FACEBOOK_SCOPE = ['email']SOCIAL_AUTH_FACEBOOK_PROFILE_EXTRA_PARAMS = {'fields': 'id, email'}+# As per march 2018, Facebook requires all traffic to go through HTTPS only+SOCIAL_AUTH_REDIRECT_IS_HTTPS = True# CELERY SETTINGSCELERY_BROKER_URL = os.environ.get('CELERY_BROKER_URL') or ''diff --git a/saleor/urls.py b/saleor/urls.pyindex f755078fb2..dce06f973e 100644--- a/saleor/urls.py+++ b/saleor/urls.py@@ -29,7 +29,8 @@ non_translatable_urlpatterns = [schema=schema, graphiql=settings.DEBUG), name='api'),url(r'^sitemap\.xml$', sitemap, {'sitemaps': sitemaps},name='django.contrib.sitemaps.views.sitemap'),- url(r'^i18n/$', set_language, name='set_language')]+ url(r'^i18n/$', set_language, name='set_language'),+ url('', include('social_django.urls', namespace='social'))]translatable_urlpatterns = [url(r'^', include(core_urls)),@@ -46,8 +47,7 @@ translatable_urlpatterns = [url(r'^feeds/',include((feed_urls, 'data_feeds'), namespace='data_feeds')),url(r'^search/', include((search_urls, 'search'), namespace='search')),- url(r'', include('payments.urls')),- url('', include('social_django.urls', namespace='social'))]+ url(r'', include('payments.urls'))]urlpatterns = non_translatable_urlpatterns + i18n_patterns(*translatable_urlpatterns)