jumpserver/apps/authentication/backends/cas/middleware.py

11 lines
347 B
Python
Raw Normal View History

from django_cas_ng.middleware import CASMiddleware as _CASMiddleware
from django.core.exceptions import MiddlewareNotUsed
from django.conf import settings
class CASMiddleware(_CASMiddleware):
2020-09-27 09:56:49 +00:00
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
if not settings.AUTH_CAS:
raise MiddlewareNotUsed