From 389092cbb40eb7146bb7fc89b3dd47c08eee2292 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Mon, 22 Jan 2024 12:43:09 +0000 Subject: [PATCH 1/2] Option to disable auth for testing --- agenda/auth.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/agenda/auth.py b/agenda/auth.py index d44696a..fc75d08 100644 --- a/agenda/auth.py +++ b/agenda/auth.py @@ -21,6 +21,9 @@ def verify_auth_token(token: str) -> str | None: def require_authentication() -> werkzeug.Response | None: """Require authentication.""" + if not flask.current_app.config.get("REQUIRE_AUTH"): + return None + token = flask.request.cookies.get("auth_token") return ( None From bdaad42eba152ce8f3d9f86962a51c3c2d8dd7c6 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Mon, 22 Jan 2024 12:43:32 +0000 Subject: [PATCH 2/2] Rename UNIAUTH_URL setting --- agenda/auth.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agenda/auth.py b/agenda/auth.py index fc75d08..925ead3 100644 --- a/agenda/auth.py +++ b/agenda/auth.py @@ -28,5 +28,5 @@ def require_authentication() -> werkzeug.Response | None: return ( None if token and verify_auth_token(token) - else flask.redirect(flask.current_app.config["UNIAUTH_LOGIN_URL"]) + else flask.redirect(flask.current_app.config["UNIAUTH_URL"] + "/login") )