Skip to content

Commit ab325af

Browse files
Merge pull request #1 from ansuha/google-login-support
Update settings.py to support google login
2 parents e2d1ff5 + a5f163d commit ab325af

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

pollme/settings.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,15 @@
3939
'django.contrib.staticfiles',
4040
'polls.apps.PollsConfig',
4141
'accounts.apps.AccountsConfig',
42+
'allauth',
43+
'allauth.account',
4244
]
4345

46+
AUTHENTICATION_BACKENDS = [
47+
'allauth.account.auth_backends.AuthenticationBackend',
48+
]
49+
50+
4451
MIDDLEWARE = [
4552
'django.middleware.security.SecurityMiddleware',
4653
'django.contrib.sessions.middleware.SessionMiddleware',
@@ -49,6 +56,7 @@
4956
'django.contrib.auth.middleware.AuthenticationMiddleware',
5057
'django.contrib.messages.middleware.MessageMiddleware',
5158
'django.middleware.clickjacking.XFrameOptionsMiddleware',
59+
'allauth.account.middleware.AccountMiddleware',
5260
]
5361

5462
ROOT_URLCONF = 'pollme.urls'
@@ -123,3 +131,16 @@
123131
STATICFILES_DIRS = [
124132
os.path.join(BASE_DIR, 'static')
125133
]
134+
135+
SOCIALACCOUNT_PROVIDERS = {
136+
'google': {
137+
'SCOPE': [
138+
'profile',
139+
'email',
140+
],
141+
'AUTH_PARAMS': {
142+
'access_type': 'online',
143+
},
144+
'OAUTH_PKCE_ENABLED': True,
145+
}
146+
}

0 commit comments

Comments
 (0)