Skip to content

Commit e099ffc

Browse files
Added async support to jwt_required view decorator (#436)
1 parent 40f15ee commit e099ffc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

flask_jwt_extended/view_decorators.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from re import split
55

66
from flask import _request_ctx_stack
7+
from flask import current_app
78
from flask import request
89
from werkzeug.exceptions import BadRequest
910

@@ -118,7 +119,7 @@ def wrapper(fn):
118119
@wraps(fn)
119120
def decorator(*args, **kwargs):
120121
verify_jwt_in_request(optional, fresh, refresh, locations)
121-
return fn(*args, **kwargs)
122+
return current_app.ensure_sync(fn)(*args, **kwargs)
122123

123124
return decorator
124125

0 commit comments

Comments
 (0)