Handle OpenStreetMap OAuth by default

This commit is contained in:
Yohan Boniface 2023-06-05 14:48:55 +02:00
parent 5190c46bf6
commit 00f34c45ba

View file

@ -259,6 +259,19 @@ SOCIAL_AUTH_PROTECTED_USER_FIELDS = ("id", )
LOGIN_URL = "login" LOGIN_URL = "login"
SOCIAL_AUTH_LOGIN_REDIRECT_URL = "/login/popup/end/" SOCIAL_AUTH_LOGIN_REDIRECT_URL = "/login/popup/end/"
AUTHENTICATION_BACKENDS = ()
SOCIAL_AUTH_OPENSTREETMAP_KEY = env('SOCIAL_AUTH_OPENSTREETMAP_KEY', default="")
SOCIAL_AUTH_OPENSTREETMAP_SECRET = env('SOCIAL_AUTH_OPENSTREETMAP_SECRET', default="")
if SOCIAL_AUTH_OPENSTREETMAP_KEY and SOCIAL_AUTH_OPENSTREETMAP_SECRET:
AUTHENTICATION_BACKENDS += (
'social_core.backends.openstreetmap.OpenStreetMapOAuth',
)
AUTHENTICATION_BACKENDS += (
'django.contrib.auth.backends.ModelBackend',
)
LOGGING = { LOGGING = {
'version': 1, 'version': 1,
'disable_existing_loggers': False, 'disable_existing_loggers': False,