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

@@ -389,9 +389,7 @@ def zulip_redirect_to_login(
):
path = request.get_full_path()
# TODO: Restore testing for this case; it was removed when
# we enabled web-public stream testing on /.
if path == "/": # nocoverage
if path == "/":
# Don't add ?next=/, to keep our URLs clean
return HttpResponseRedirect(resolved_login_url)
return redirect_to_login(path, resolved_login_url, redirect_field_name)