diff --git a/src/eherkenning/mock/eherkenning_urls.py b/src/eherkenning/mock/eherkenning_urls.py index 2e35efa36e..3f38e7b756 100644 --- a/src/eherkenning/mock/eherkenning_urls.py +++ b/src/eherkenning/mock/eherkenning_urls.py @@ -3,7 +3,6 @@ from eherkenning.mock.views.eherkenning import ( eHerkenningAssertionConsumerServiceMockView, eHerkenningLoginMockView, - eHerkenningLogoutMockView, ) """ @@ -15,5 +14,4 @@ urlpatterns = ( path("login/", eHerkenningLoginMockView.as_view(), name="login"), path("acs/", eHerkenningAssertionConsumerServiceMockView.as_view(), name="acs"), - path("logout/", eHerkenningLogoutMockView.as_view(), name="logout"), ) diff --git a/src/eherkenning/mock/views/eherkenning.py b/src/eherkenning/mock/views/eherkenning.py index ff28a345c7..b2e2060a96 100644 --- a/src/eherkenning/mock/views/eherkenning.py +++ b/src/eherkenning/mock/views/eherkenning.py @@ -3,7 +3,6 @@ from django.conf import settings from django.contrib import auth, messages -from django.contrib.auth.views import LogoutView from django.http import HttpResponseBadRequest, HttpResponseRedirect from django.shortcuts import resolve_url from django.urls import reverse @@ -101,8 +100,3 @@ def get(self, request): auth.login(request, user) return HttpResponseRedirect(self.get_success_url()) - - -class eHerkenningLogoutMockView(LogoutView): - # in the future we can render a custom template to emulate eHerkenning logout page - pass diff --git a/src/eherkenning/tests/test_mock_views.py b/src/eherkenning/tests/test_mock_views.py index 1f881af754..57b7ea3d4e 100644 --- a/src/eherkenning/tests/test_mock_views.py +++ b/src/eherkenning/tests/test_mock_views.py @@ -3,7 +3,7 @@ from django.contrib.auth import get_user_model from django.test import TestCase, modify_settings, override_settings -from django.urls import reverse, reverse_lazy +from django.urls import reverse from furl import furl @@ -166,18 +166,3 @@ def test_post_redirect_retains_acs_querystring_params(self): self.assertRedirects( response, str(expected_redirect), fetch_redirect_response=False ) - - -@override_settings(**OVERRIDE_SETTINGS) -@modify_settings(**MODIFY_SETTINGS) -class LogoutViewTests(TestCase): - def test_logout(self): - User = get_user_model() - user = User.objects.create_user(email="testuser@localhost", password="test") - self.client.force_login(user) - - url = reverse("eherkenning:logout") - response = self.client.get(url) - - self.assertEqual(response.status_code, 302) - self.assertFalse("_auth_user_id" in self.client.session) diff --git a/src/open_inwoner/accounts/models.py b/src/open_inwoner/accounts/models.py index 529b45c7b9..0828fd446f 100644 --- a/src/open_inwoner/accounts/models.py +++ b/src/open_inwoner/accounts/models.py @@ -420,7 +420,7 @@ def get_logout_url(self) -> str: elif self.login_type == LoginTypeChoices.eherkenning: if OpenIDConnectEHerkenningConfig.get_solo().enabled: return reverse("eherkenning_oidc:logout") - return reverse("eherkenning:logout") + return reverse("logout") def get_contact_update_url(self): return reverse("profile:contact_edit", kwargs={"uuid": self.uuid}) diff --git a/src/open_inwoner/accounts/tests/test_profile_views.py b/src/open_inwoner/accounts/tests/test_profile_views.py index 257c954c7e..1ea636c106 100644 --- a/src/open_inwoner/accounts/tests/test_profile_views.py +++ b/src/open_inwoner/accounts/tests/test_profile_views.py @@ -103,7 +103,7 @@ def test_show_correct_logout_button_for_login_type_eherkenning(self, mock_solo): logout_url = ( reverse("eherkenning_oidc:logout") if oidc_enabled - else reverse("eherkenning:logout") + else reverse("logout") ) response = self.app.get(self.url, user=self.eherkenning_user)