Skip to content

Commit

Permalink
Dont require login when running test config
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonyhashemi committed Oct 31, 2023
1 parent 9247e44 commit d25c1a0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/main/authorize/keycloak_login_required_decorator.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from functools import wraps

from flask import flash, redirect, session, url_for
from flask import current_app, flash, redirect, session, url_for

from app.main.authorize.keycloak_manager import get_keycloak_openid_object
from app.main.aws.parameter import (
Expand All @@ -13,6 +13,9 @@ def access_token_login_required():
def decorator(view_func):
@wraps(view_func)
def decorated_view(*args, **kwargs):
if current_app.config["TESTING"]:
return view_func(*args, **kwargs)

access_token = session.get("access_token")
if not access_token:
return redirect(url_for("main.login"))
Expand Down

0 comments on commit d25c1a0

Please sign in to comment.