From c9935d0a04a6056b5dde5c42dffd60076f8c82b3 Mon Sep 17 00:00:00 2001 From: Bernard Siebens Date: Mon, 13 Jul 2026 23:21:56 +0200 Subject: [PATCH] Add Cancel to the sign-out page, and icons to both buttons Sign Out keeps btn-primary and gains a log-out icon; Cancel sits beside it as a plain button with a back arrow. Cancel links to "/" rather than the Referer header. "/" already resolves per tenant -- club home on a club subdomain, control panel on the base domain -- whereas Referer can be absent or point off-site, which is not something to render as a link unchecked. It is an anchor, not a submit, so it cannot post the form: a test asserts that clicking it leaves the session signed in. Co-Authored-By: Claude Opus 4.8 --- authentication/tests.py | 26 ++++++++++++++++++++++++++ templates/account/logout.html | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 templates/account/logout.html diff --git a/authentication/tests.py b/authentication/tests.py index becf899..ecf7798 100644 --- a/authentication/tests.py +++ b/authentication/tests.py @@ -362,3 +362,29 @@ class ActionBarTests(TestCase): self.assertContains(response, "btn-error") self.assertContains(response, 'type="submit"') + + +class SignOutPageTests(TestCase): + def setUp(self): + self.user = User.objects.create_user(email="mfa@example.com", password="pw-secret-123") + self.client.force_login(self.user) + self.response = self.client.get(reverse("account_logout")) + + def test_sign_out_and_cancel_sit_side_by_side_with_icons(self): + html = self.response.content.decode() + cancel = html[html.index('') :] + sign_out = html[html.index(' + + +{% endblock content %}