diff --git a/auth_backends/views.py b/auth_backends/views.py index 54fb02a9..61371b42 100644 --- a/auth_backends/views.py +++ b/auth_backends/views.py @@ -35,13 +35,20 @@ class LogoutRedirectBaseView(RedirectView): def dispatch(self, request, *args, **kwargs): # Keep track of the user so that child classes have access to it after logging out. self.user = request.user - logout(request) if request.GET.get('no_redirect'): + logout(request) return HttpResponse() return super(LogoutRedirectBaseView, self).dispatch(request, *args, **kwargs) + @method_decorator(xframe_options_exempt) + def post(self, request, *args, **kwargs): + # Keep track of the user so that child classes have access to it after logging out. + self.user = request.user + logout(request) + return HttpResponse() + @property def url(self): # NOTE: We use a property here so that we can take advantage of the base class'