Compare commits
No commits in common. "cc3dc81bdbcddccaeb3a649f8a94fb3b58c11bae" and "d41d53367fdb6462e3625f8a375a501fdc26ab3c" have entirely different histories.
cc3dc81bdb
...
d41d53367f
|
@ -21,16 +21,13 @@ def verify_auth_token(token: str) -> str | None:
|
|||
|
||||
def require_authentication() -> werkzeug.Response | None:
|
||||
"""Require authentication and redirect with return URL."""
|
||||
if not flask.current_app.config.get("REQUIRE_AUTH"):
|
||||
return None
|
||||
|
||||
token = flask.request.cookies.get("auth_token")
|
||||
if token and verify_auth_token(token):
|
||||
return None
|
||||
|
||||
# Construct the redirect URL with the original URL as a parameter
|
||||
return flask.redirect(
|
||||
flask.current_app.config["UNIAUTH_URL"]
|
||||
+ "/login?next="
|
||||
flask.current_app.config["UNIAUTH_LOGIN_URL"]
|
||||
+ "?next="
|
||||
+ werkzeug.urls.url_quote(flask.request.url)
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue