Add a logout hook
|Reported by:||Boris Bobrov||Owned by:|
It could be useful to have a hook in the logout view for authentication plugins.
For example, I've made a plugin to use HTTP Authentication but the logout need to be done externally. I've made the attached patch which allows to redirect to any other internal/external page, but it can be discussed and ameliorated...
Thanks in advance!
diff --git a/mediagoblin/auth/views.py b/mediagoblin/auth/views.py index 03a46f7..9f15563 100644 --- a/mediagoblin/auth/views.py +++ b/mediagoblin/auth/views.py @@ -120,7 +120,11 @@ def logout(request): # Maybe deleting the user_id parameter would be enough? request.session.delete() - return redirect(request, "index") + response = hook_handle('auth_logout_response', request) + if response: + return response + else: + return redirect(request, 'index')