From e12780f78ff25fffa2ed4c32d1535d20bb76e178 Mon Sep 17 00:00:00 2001
From: Jens Langhammer
Date: Mon, 11 May 2020 01:12:57 +0200
Subject: [PATCH] flows: add invalidation designation, use as default logout
action
---
passbook/core/templates/base/page.html | 2 +-
.../core/tests/test_views_authentication.py | 45 -------------------
passbook/core/urls.py | 4 +-
passbook/core/views/authentication.py | 21 ---------
.../flows/migrations/0002_default_flows.py | 45 +++++++++++++++++--
.../migrations/0004_auto_20200510_2310.py | 18 ++++++++
passbook/flows/models.py | 1 +
passbook/flows/urls.py | 5 +++
.../templates/oauth2_provider/authorize.html | 2 +-
.../templates/oidc_provider/authorize.html | 2 +-
.../templates/saml/idp/autosubmit_form.html | 2 +-
.../saml/templates/saml/idp/login.html | 2 +-
passbook/root/urls.py | 3 ++
13 files changed, 75 insertions(+), 77 deletions(-)
delete mode 100644 passbook/core/tests/test_views_authentication.py
delete mode 100644 passbook/core/views/authentication.py
create mode 100644 passbook/flows/migrations/0004_auto_20200510_2310.py
diff --git a/passbook/core/templates/base/page.html b/passbook/core/templates/base/page.html
index 3d6b6702d..27a793e28 100644
--- a/passbook/core/templates/base/page.html
+++ b/passbook/core/templates/base/page.html
@@ -40,7 +40,7 @@
diff --git a/passbook/providers/saml/templates/saml/idp/login.html b/passbook/providers/saml/templates/saml/idp/login.html
index 1126d5bda..d4257cab7 100644
--- a/passbook/providers/saml/templates/saml/idp/login.html
+++ b/passbook/providers/saml/templates/saml/idp/login.html
@@ -16,7 +16,7 @@
{% blocktrans with user=user %}
You are logged in as {{ user }}.
{% endblocktrans %}
- {% trans 'Not you?' %}
+ {% trans 'Not you?' %}
diff --git a/passbook/root/urls.py b/passbook/root/urls.py
index 73adb5531..a418d097c 100644
--- a/passbook/root/urls.py
+++ b/passbook/root/urls.py
@@ -12,6 +12,9 @@ from passbook.root.monitoring import MetricsView
LOGGER = get_logger()
admin.autodiscover()
admin.site.login = RedirectView.as_view(pattern_name="passbook_flows:default-auth")
+admin.site.logout = RedirectView.as_view(
+ pattern_name="passbook_flows:default-invalidate"
+)
handler400 = error.BadRequestView.as_view()
handler403 = error.ForbiddenView.as_view()