New version fixes.
[wolnelektury.git] / src / wolnelektury / settings / auth.py
index 4d3ea22..d482499 100644 (file)
@@ -1,9 +1,12 @@
+# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
+# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
+#
 AUTHENTICATION_BACKENDS = [
     'django.contrib.auth.backends.ModelBackend',
 AUTHENTICATION_BACKENDS = [
     'django.contrib.auth.backends.ModelBackend',
-    'allauth.account.auth_backends.AuthenticationBackend',
+    'allauth.account.auth_backends.AuthenticationBackend',
 ]
 ACCOUNT_EMAIL_CONFIRMATION_EXPIRE_DAYS = 2
 ]
 ACCOUNT_EMAIL_CONFIRMATION_EXPIRE_DAYS = 2
-LOGIN_URL = '/uzytkownik/login/'
+LOGIN_URL = '/uzytkownik/zaloguj-utworz/'
 
 LOGIN_REDIRECT_URL = '/'
 
 
 LOGIN_REDIRECT_URL = '/'
 
@@ -11,9 +14,36 @@ SOCIALACCOUNT_AUTO_SIGNUP = False
 SOCIALACCOUNT_QUERY_EMAIL = True
 
 
 SOCIALACCOUNT_QUERY_EMAIL = True
 
 
-SOCIALACCOUNT_PROVIDERS = \
-    { 'openid':
-        { 'SERVERS':
-            [dict(id='google',
-                  name='Google',
-                  openid_url='https://www.google.com/accounts/o8/id')]}}
+SOCIALACCOUNT_PROVIDERS = {
+    'openid': {
+        'SERVERS': [],
+    },
+    'google': {
+        'AUTH_PARAMS': {
+            'access_type': 'online',
+        }
+    },
+    'facebook': {
+        'METHOD': 'oauth2',
+        'SCOPE': ['email', 'public_profile'],
+        # 'AUTH_PARAMS': {'auth_type': 'reauthenticate'},
+        # 'INIT_PARAMS': {'cookie': True},
+        # 'FIELDS': [
+        #     'id',
+        #     'email',
+        #     'name',
+        #     'first_name',
+        #     'last_name',
+        #     'verified',
+        #     'locale',
+        #     'timezone',
+        #     'link',
+        #     'gender',
+        #     'updated_time',
+        # ],
+        # 'EXCHANGE_TOKEN': True,
+        # 'LOCALE_FUNC': 'path.to.callable',
+        # 'VERIFIED_EMAIL': False,
+        'VERSION': 'v2.12',
+    },
+}