Add middleware classes dynamically from configuration and switch MIDDLEWARE_CLASSES to use a list
This commit is contained in:
@@ -11,9 +11,9 @@ If true, it:
|
||||
"""
|
||||
|
||||
_FIELDS_STORED_IN_SESSION = ['auth_entry', 'next']
|
||||
_MIDDLEWARE_CLASSES = (
|
||||
_MIDDLEWARE_CLASSES = [
|
||||
'third_party_auth.middleware.ExceptionMiddleware',
|
||||
)
|
||||
]
|
||||
_SOCIAL_AUTH_LOGIN_REDIRECT_URL = '/dashboard'
|
||||
_SOCIAL_AUTH_AZUREAD_OAUTH2_AUTH_EXTRA_ARGUMENTS = {
|
||||
'msafed': 0
|
||||
@@ -28,7 +28,7 @@ def apply_settings(django_settings):
|
||||
django_settings.FIELDS_STORED_IN_SESSION = _FIELDS_STORED_IN_SESSION
|
||||
|
||||
# Inject exception middleware to make redirects fire.
|
||||
django_settings.MIDDLEWARE_CLASSES += _MIDDLEWARE_CLASSES
|
||||
django_settings.MIDDLEWARE_CLASSES.extend(_MIDDLEWARE_CLASSES)
|
||||
|
||||
# Where to send the user if there's an error during social authentication
|
||||
# and we cannot send them to a more specific URL
|
||||
|
||||
@@ -7,7 +7,7 @@ from third_party_auth.tests import testutil
|
||||
|
||||
_ORIGINAL_AUTHENTICATION_BACKENDS = ('first_authentication_backend',)
|
||||
_ORIGINAL_INSTALLED_APPS = ('first_installed_app',)
|
||||
_ORIGINAL_MIDDLEWARE_CLASSES = ('first_middleware_class',)
|
||||
_ORIGINAL_MIDDLEWARE_CLASSES = ['first_middleware_class']
|
||||
_ORIGINAL_TEMPLATE_CONTEXT_PROCESSORS = ('first_template_context_preprocessor',)
|
||||
_SETTINGS_MAP = {
|
||||
'AUTHENTICATION_BACKENDS': _ORIGINAL_AUTHENTICATION_BACKENDS,
|
||||
|
||||
Reference in New Issue
Block a user