Skip to content

Commit

Permalink
Merge pull request #224 from fecgov/feature/328-logout-for-login-dot-gov
Browse files Browse the repository at this point in the history
Feature/411 Fix logout redirect
  • Loading branch information
mjtravers authored Sep 8, 2022
2 parents 4ac76ce + afe14f4 commit 788a0d5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions django-backend/fecfiler/authentication/views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django.views.generic import View
from django.http import HttpResponse, HttpResponseRedirect
from django.http import HttpResponseRedirect

from fecfiler.settings import (
LOGIN_REDIRECT_CLIENT_URL,
Expand Down Expand Up @@ -65,9 +65,11 @@ def get(self, request, *args, **kwargs):

class LoginDotGovSuccessLogoutSpaRedirect(View):
def get(self, request, *args, **kwargs):
response = HttpResponse(status=204) # no content
response = HttpResponseRedirect(LOGIN_REDIRECT_CLIENT_URL)
response.delete_cookie(FFAPI_COMMITTEE_ID_COOKIE_NAME,
domain=FFAPI_COOKIE_DOMAIN)
response.delete_cookie(FFAPI_EMAIL_COOKIE_NAME,
domain=FFAPI_COOKIE_DOMAIN)
response.delete_cookie('csrftoken',
domain=FFAPI_COOKIE_DOMAIN)
return response

0 comments on commit 788a0d5

Please sign in to comment.