Commit 20433b20 authored by Florent Chehab's avatar Florent Chehab

CAS infinite redirect fixed.

Redirect after login to requested page added.
parent be0a622d
Pipeline #21991 passed with stages
in 1 minute and 21 seconds
......@@ -30,4 +30,4 @@ class LoginRequiredMiddleware(MiddlewareMixin):
if not request.user.is_authenticated:
path = request.path_info.lstrip('/')
if not any(m.match(path) for m in EXEMPT_URLS):
return HttpResponseRedirect(settings.LOGIN_URL)
return HttpResponseRedirect(settings.LOGIN_URL + "?next=/" + path)
......@@ -44,7 +44,7 @@ MIDDLEWARE = [
'general.middleware.LoginRequiredMiddleware',
]
LOGIN_URL = 'accounts/login'
LOGIN_URL = '/accounts/login'
# TODO add ignore administration
AUTHENTICATION_BACKENDS = [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment