0.11.0 Google Auth

This commit is contained in:
SDE
2024-01-13 14:49:32 +03:00
parent bf18c96dbd
commit 2e1f3a10ab
4 changed files with 32 additions and 4 deletions

View File

@@ -36,6 +36,25 @@ WEBPUSH_SETTINGS = {
"VAPID_ADMIN_EMAIL": "admin@tripwb.com"
}
AUTHENTICATION_BACKENDS = [
'django.contrib.auth.backends.ModelBackend',
'allauth.account.auth_backends.AuthenticationBackend',
]
SOCIALACCOUNT_PROVIDERS = {
'google': {
'SCOPE': [
'profile',
'email',
],
'AUTH_PARAMS': {
'access_type': 'online',
},
}
}
# NOTIFICATION_KEY = 'BJLyGzmo8sLI3Qkc6pN2cz11frCXiJdewvgve7Yps-_fM1lY1LSnTQfQxYtAgQ_26nAji_rgeYC1DkLiTwxw0Mo'
# SESSION_COOKIE_HTTPONLY = False
@@ -63,6 +82,11 @@ INSTALLED_APPS = [
'webpush',
'allauth',
'allauth.account',
'allauth.socialaccount',
'allauth.socialaccount.providers.google',
'GeneralApp',
'AuthApp',
'RoutesApp',
@@ -82,6 +106,8 @@ MIDDLEWARE = [
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'AuthApp.middleware.ResponseInterceptionMiddleware',
"allauth.account.middleware.AccountMiddleware",
]
ROOT_URLCONF = 'TWB.urls'

View File

@@ -12,7 +12,7 @@ urlpatterns = [
path('ckeditor/', include('ckeditor_uploader.urls')),
path('i18n/', include('django.conf.urls.i18n')),
# path('webpush/', include('webpush.urls')),
path('accounts/', include('allauth.urls')),
path('messages/', include('ChatServiceApp.urls')),