diff --git a/app/__init__.py b/app/__init__.py index c5f1e58..16aa9a6 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -14,4 +14,6 @@ def create_app(): from app.config import FlaskTesting, FlaskProduction app.config.from_object(FlaskTesting) + from . import jwt_utils + return app \ No newline at end of file diff --git a/app/jwt_utils.py b/app/jwt_utils.py index 2df5ae7..96f050c 100644 --- a/app/jwt_utils.py +++ b/app/jwt_utils.py @@ -2,11 +2,11 @@ from app.extensions import jwt_redis_blocklist from . import jwt_manager -@jwt.token_in_blocklist_loader +from app import app + +@jwt_manager.token_in_blocklist_loader def check_if_token_is_revoked(jwt_header, jwt_payload: dict) -> bool: jti = jwt_payload["jti"] token_in_redis = jwt_redis_blocklist.get(jti) - print(token_in_redis) - return token_in_redis is not None