1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-10 20:26:48 +00:00

fix(accounts): a signed-in user is sent on from the login page

The login page showed its sign-in card to a user who was already signed
in, with the navbar squeezed beside it. Both login views, with and
without OTP, now send that user to the page in next, or to the default
page when next is missing or points elsewhere. Every permission check
answers 403 instead of redirecting to the login, so this cannot loop.
The page test renders the login page signed out.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
catborise 2026-10-21 20:24:20 +03:00
parent 676bcfeb09
commit 961b43a42e
5 changed files with 22 additions and 0 deletions

View file

@ -55,6 +55,11 @@ class PageTests(TestCase):
self.assertEqual(response.status_code, 200)
checked.append("network")
yield "network", html.fromstring(response.content)
# a signed-in user is sent on from the login page
response = self.client_class().get(reverse("accounts:login"))
self.assertEqual(response.status_code, 200)
checked.append("accounts:login")
yield "accounts:login", html.fromstring(response.content)
self.assertTrue({"index", "overview", "instances:instance", "nwfilter"} <= set(checked), checked)
self.assertIn("instances:create_instance", checked)