diff --git a/flask_jwt_extended/view_decorators.py b/flask_jwt_extended/view_decorators.py index ee5e3041..9a267146 100644 --- a/flask_jwt_extended/view_decorators.py +++ b/flask_jwt_extended/view_decorators.py @@ -4,6 +4,7 @@ from re import split from flask import _request_ctx_stack +from flask import current_app from flask import request from werkzeug.exceptions import BadRequest @@ -118,7 +119,7 @@ def wrapper(fn): @wraps(fn) def decorator(*args, **kwargs): verify_jwt_in_request(optional, fresh, refresh, locations) - return fn(*args, **kwargs) + return current_app.ensure_sync(fn)(*args, **kwargs) return decorator