1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-16 15:19:06 +00:00

[shibboleth] Only apply middleware to certain url

This commit is contained in:
zhengxie
2018-09-15 16:13:07 +08:00
parent 70ff50b30f
commit a45e6b5cdd

View File

@@ -31,6 +31,9 @@ class ShibbolethRemoteUserMiddleware(RemoteUserMiddleware):
super(ShibbolethRemoteUserMiddleware, self).__init__(*a, **kw)
def process_request(self, request):
if request.path.rstrip('/') != settings.SITE_ROOT + 'sso':
return
# AuthenticationMiddleware is required so that request.user exists.
if not hasattr(request, 'user'):
raise ImproperlyConfigured(