diff --git a/datafundament_fb/datafundament_fb/settings/base.py b/datafundament_fb/datafundament_fb/settings/base.py index 8f1436e..7d858c3 100644 --- a/datafundament_fb/datafundament_fb/settings/base.py +++ b/datafundament_fb/datafundament_fb/settings/base.py @@ -77,6 +77,7 @@ 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', + 'shared.context_processors.authentication_urls', ], }, }, @@ -180,6 +181,7 @@ # Authentication settings AUTHENTICATION_BACKENDS = ['mozilla_django_oidc.auth.OIDCAuthenticationBackend',] LOGIN_URL = "oidc_authentication_init" +LOGOUT_URL = "oidc_logout" LOGIN_REDIRECT_URL = "/" LOGOUT_REDIRECT_URL = "/" diff --git a/datafundament_fb/datafundament_fb/settings/local.py b/datafundament_fb/datafundament_fb/settings/local.py index 82af45f..ad747e3 100644 --- a/datafundament_fb/datafundament_fb/settings/local.py +++ b/datafundament_fb/datafundament_fb/settings/local.py @@ -10,4 +10,5 @@ # Settings specific to this enviromnent AUTHENTICATION_BACKENDS = ['django.contrib.auth.backends.ModelBackend'] -LOGIN_URL = '/auth/login' +LOGIN_URL = 'login' +LOGOUT_URL = 'logout' diff --git a/datafundament_fb/datafundament_fb/urls.py b/datafundament_fb/datafundament_fb/urls.py index c6c0cd5..5bff7ac 100644 --- a/datafundament_fb/datafundament_fb/urls.py +++ b/datafundament_fb/datafundament_fb/urls.py @@ -31,9 +31,6 @@ else: urlpatterns = [ path('oidc/', include("mozilla_django_oidc.urls")), - # This will, purposefully, never hit, but will provide a reverse lookup for the logout/login url - path('oidc/authenticate/', OIDCAuthenticationRequestView.as_view(), name='login'), - path('oidc/logout/', OIDCLogoutView.as_view(), name='logout'), ] urlpatterns.extend([ diff --git a/datafundament_fb/shared/context_processors.py b/datafundament_fb/shared/context_processors.py new file mode 100644 index 0000000..f0cff46 --- /dev/null +++ b/datafundament_fb/shared/context_processors.py @@ -0,0 +1,7 @@ +from django.conf import settings + +def authentication_urls(request): + return { + 'LOGIN_URL': settings.LOGIN_URL, + 'LOGOUT_URL': settings.LOGOUT_URL, + } \ No newline at end of file diff --git a/datafundament_fb/templates/site-base.html b/datafundament_fb/templates/site-base.html index a2255b4..dbc98ed 100644 --- a/datafundament_fb/templates/site-base.html +++ b/datafundament_fb/templates/site-base.html @@ -46,13 +46,13 @@