state api now working
This commit is contained in:
@@ -132,12 +132,6 @@ jwt_extended = JWTManager(app)
|
||||
jwt_auth = HTTPTokenAuth('Bearer')
|
||||
|
||||
|
||||
@jwt_extended.invalid_token_loader
|
||||
def unauthorized_jwt(token):
|
||||
main_logger.info("Unauthorized access; invalid token provided: {}".format(token))
|
||||
abort(401)
|
||||
|
||||
|
||||
@jwt_auth.verify_token
|
||||
def verify_token(token):
|
||||
"""This function (and HTTPTokenAuth('Bearer')) has been defined to be used together with MultiAuth. For API calls
|
||||
@@ -178,5 +172,17 @@ app.register_blueprint(fe_bp)
|
||||
CORS(app)
|
||||
CORS(api_bp)
|
||||
|
||||
# Fix jwt_extended by duck typing error handlers
|
||||
jwt_extended._set_error_handler_callbacks(api_v1)
|
||||
# Fix jwt_extended by 'duck typing' error handlers
|
||||
# jwt_extended._set_error_handler_callbacks(api_v1) # removed for the moment, might raise new (old) problems
|
||||
|
||||
|
||||
@jwt_extended.invalid_token_loader
|
||||
def unauthorized_jwt(token):
|
||||
main_logger.info("Unauthorized access; invalid token provided: {}".format(token))
|
||||
abort(401)
|
||||
|
||||
|
||||
@jwt_extended.expired_token_loader
|
||||
def unauthorized_jwt(token):
|
||||
main_logger.info("Unauthorized access; expired token provided: {}".format(token))
|
||||
abort(401)
|
||||
|
||||
Reference in New Issue
Block a user