From 652b247860c9d5a8aa50ff4bb4cc67ba26000aaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20=C5=A0milauer?= Date: Tue, 25 Jun 2024 09:36:22 +0200 Subject: [PATCH] Indicate visibly to the user that auth is not available --- webapi/index.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/webapi/index.py b/webapi/index.py index 5d7a0c0..4ee0d6b 100644 --- a/webapi/index.py +++ b/webapi/index.py @@ -177,7 +177,7 @@ def login_header_html(): html += f'
{current_user.name}
{current_user.email}
Logout
' html = '
' + html + f'
' else: - html += 'Login' + html += 'Login'+(' (unavailable) ' if GOOGLE_DISCOVERY_URL is None else '')+'' return Markup(html) @@ -201,6 +201,8 @@ def get_google_provider_cfg(): @app.route("/login") def login(): + if GOOGLE_DISCOVERY_URL is None: + return 'NOT IMPLEMENTED

Login not configured

This instance of MuPIF container is missing login configuration, it is a problem on the server side. Sorry.

',501 google_provider_cfg = get_google_provider_cfg() authorization_endpoint = google_provider_cfg["authorization_endpoint"] request_uri = client.prepare_request_uri(