ebanutsya
This commit is contained in:
12
routes/utils.py
Normal file
12
routes/utils.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from functools import wraps
|
||||
|
||||
from flask import Blueprint
|
||||
from flask_jwt_extended import verify_jwt_in_request
|
||||
|
||||
|
||||
def jwt_protect_blueprint(blueprint) -> Blueprint:
|
||||
@blueprint.before_request
|
||||
def require_token():
|
||||
verify_jwt_in_request()
|
||||
|
||||
return blueprint
|
||||
Reference in New Issue
Block a user