main
Bob Mottram 2024-04-10 10:28:34 +01:00
parent 952522a9ff
commit 40713760ed
2 changed files with 7 additions and 5 deletions

View File

@ -2239,7 +2239,9 @@ def daemon_http_get(self) -> None:
self.server.onion_domain,
self.server.i2p_domain,
getreq_start_time,
authorized, self.server.debug):
authorized, self.server.debug,
self.server.news_instance,
self.server.fitness):
return
fitness_performance(getreq_start_time, self.server.fitness,

View File

@ -16,7 +16,8 @@ def redirect_to_login_screen(self, calling_domain: str, path: str,
http_prefix: str, domain_full: str,
onion_domain: str, i2p_domain: str,
getreq_start_time,
authorized: bool, debug: bool):
authorized: bool, debug: bool,
news_instance: bool, fitness: {}) -> bool:
"""Redirects to the login screen if necessary
"""
divert_to_login_screen = False
@ -49,7 +50,7 @@ def redirect_to_login_screen(self, calling_domain: str, path: str,
if divert_to_login_screen and not authorized:
divert_path = '/login'
if self.server.news_instance:
if news_instance:
# for news instances if not logged in then show the
# front page
divert_path = '/users/news'
@ -64,8 +65,7 @@ def redirect_to_login_screen(self, calling_domain: str, path: str,
onion_domain, i2p_domain) + \
divert_path
redirect_headers(self, redirect_url, None, calling_domain)
fitness_performance(getreq_start_time,
self.server.fitness,
fitness_performance(getreq_start_time, fitness,
'_GET', '_redirect_to_login_screen',
debug)
return True