From 39047a8dad1db4fc714755ebccfc171ade6c63a0 Mon Sep 17 00:00:00 2001
From: David Heitzer <david.heitzer@tcg.com>
Date: Wed, 7 Sep 2022 14:34:59 -0400
Subject: [PATCH 1/3] 328 logout fix

---
 django-backend/fecfiler/authentication/views.py | 4 ++--
 tasks.py                                        | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/django-backend/fecfiler/authentication/views.py b/django-backend/fecfiler/authentication/views.py
index 1c57482239..dc672267f2 100644
--- a/django-backend/fecfiler/authentication/views.py
+++ b/django-backend/fecfiler/authentication/views.py
@@ -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,
@@ -65,7 +65,7 @@ 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,
diff --git a/tasks.py b/tasks.py
index b950dbda14..4227db1884 100644
--- a/tasks.py
+++ b/tasks.py
@@ -45,7 +45,7 @@ def _detect_space(repo, branch=None):
 DEPLOY_RULES = (
     ("prod", lambda _, branch: branch == "main"),
     ("stage", lambda _, branch: branch.startswith("release")),
-    ("dev", lambda _, branch: branch == "develop"),
+    ("dev", lambda _, branch: branch == "feature/328-logout-for-login-dot-gov"),
 )
 
 

From e073b2f268ed341ecb90d203783975d1373d56c9 Mon Sep 17 00:00:00 2001
From: David Heitzer <david.heitzer@tcg.com>
Date: Wed, 7 Sep 2022 15:46:26 -0400
Subject: [PATCH 2/3] fixed csrf cookie not removed during logout

---
 django-backend/fecfiler/authentication/views.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/django-backend/fecfiler/authentication/views.py b/django-backend/fecfiler/authentication/views.py
index dc672267f2..69f2eefd2b 100644
--- a/django-backend/fecfiler/authentication/views.py
+++ b/django-backend/fecfiler/authentication/views.py
@@ -70,4 +70,6 @@ def get(self, request, *args, **kwargs):
                                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

From afe14f44ac57dd184e3fe6d79eae2894d9ad590c Mon Sep 17 00:00:00 2001
From: David Heitzer <david.heitzer@tcg.com>
Date: Wed, 7 Sep 2022 15:58:26 -0400
Subject: [PATCH 3/3] 328 add dev branch back to tasks.py

---
 tasks.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tasks.py b/tasks.py
index 4227db1884..b950dbda14 100644
--- a/tasks.py
+++ b/tasks.py
@@ -45,7 +45,7 @@ def _detect_space(repo, branch=None):
 DEPLOY_RULES = (
     ("prod", lambda _, branch: branch == "main"),
     ("stage", lambda _, branch: branch.startswith("release")),
-    ("dev", lambda _, branch: branch == "feature/328-logout-for-login-dot-gov"),
+    ("dev", lambda _, branch: branch == "develop"),
 )