Skip to content

Commit

Permalink
Added async support to jwt_required view decorator (#436)
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanVDWeide authored Jul 5, 2021
1 parent 40f15ee commit e099ffc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion flask_jwt_extended/view_decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit e099ffc

Please sign in to comment.