auth: Add login buttons for web public access.

For users who are not logged in and for those who don't have
'prefers_web_public_view' set in session, we redirect them
to the default login page where they can choose to login
as spectator or authenticated user.
This commit is contained in:
Aman Agrawal
2020-10-07 10:40:02 +05:30
committed by Tim Abbott
parent cc8cb5432e
commit 3b29c61409
12 changed files with 99 additions and 20 deletions

View File

@@ -524,15 +524,6 @@ Output:
# not as a spectator.
self.assertEqual(page_params["is_spectator"], False)
def check_rendered_spectator(self, result: HttpResponse) -> None:
"""Verifies that a visit of / was a 200 that rendered page_params
for a (logged-out) spectator."""
self.assertEqual(result.status_code, 200)
page_params = self._get_page_params(result)
# It is important to check `is_spectator` to verify
# that we treated this request to render for a `spectator`
self.assertEqual(page_params["is_spectator"], True)
def login_with_return(
self, email: str, password: Optional[str] = None, **kwargs: Any
) -> HttpResponse: