Option to disable auth for testing

This commit is contained in:
Edward Betts 2024-01-22 12:43:09 +00:00
parent 2b89ff7ff9
commit 389092cbb4

View file

@ -21,6 +21,9 @@ def verify_auth_token(token: str) -> str | None:
def require_authentication() -> werkzeug.Response | None: def require_authentication() -> werkzeug.Response | None:
"""Require authentication.""" """Require authentication."""
if not flask.current_app.config.get("REQUIRE_AUTH"):
return None
token = flask.request.cookies.get("auth_token") token = flask.request.cookies.get("auth_token")
return ( return (
None None