Commit aa5bb7ef authored by Valentin Samir's avatar Valentin Samir

Use url parameter on logout

parent 5e54ffcc
......@@ -84,11 +84,15 @@ class LogoutView(View, LogoutMixin):
"""methode called on GET request on this view"""
self.request = request
self.service = request.GET.get('service')
self.url = request.GET.get('url')
self.logout()
# if service is set, redirect to service after logout
if self.service:
list(messages.get_messages(request)) # clean messages before leaving the django app
return HttpResponseRedirect(self.service)
elif self.url:
list(messages.get_messages(request)) # clean messages before leaving the django app
return HttpResponseRedirect(self.url)
# else redirect to login page
else:
if settings.CAS_REDIRECT_TO_LOGIN_AFTER_LOGOUT:
......
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