This commit is contained in:
parent
1de1cb4086
commit
b386525e0c
10 changed files with 51 additions and 15 deletions
|
|
@ -64,6 +64,7 @@ OAUTH_SERVER_URL = config("OAUTH_SERVER_URL", default="")
|
|||
OAUTH_BUTTON_TEXT = config("OAUTH_BUTTON_TEXT", default="Login with OAuth")
|
||||
OAUTH_BUTTON_IMAGE = config("OAUTH_BUTTON_IMAGE", default="")
|
||||
OAUTH_SCOPE = config("OAUTH_SCOPE", default="openid profile email", cast=Csv(delimiter=" "))
|
||||
OAUTH_ADMIN_GROUP = config("OAUTH_ADMIN_GROUP", default="")
|
||||
|
||||
INSTALLED_APPS = [
|
||||
"django.contrib.admin",
|
||||
|
|
@ -118,6 +119,7 @@ TEMPLATES = [
|
|||
"django.template.context_processors.request",
|
||||
"django.contrib.auth.context_processors.auth",
|
||||
"django.contrib.messages.context_processors.messages",
|
||||
"photo21.views.oauth_context",
|
||||
],
|
||||
},
|
||||
},
|
||||
|
|
@ -282,6 +284,9 @@ ACCOUNT_FORMS = {"signup": "photo21.forms.CustomSignupForm"}
|
|||
|
||||
if OAUTH_ENABLED:
|
||||
SOCIALACCOUNT_ONLY = OAUTH_ONLY
|
||||
if OAUTH_ONLY:
|
||||
ACCOUNT_EMAIL_VERIFICATION = 'none'
|
||||
SOCIALACCOUNT_LOGIN_ON_GET = True
|
||||
SOCIALACCOUNT_PROVIDERS = {
|
||||
"oauth": {
|
||||
"SCOPE": OAUTH_SCOPE,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue