Пример #1
0
                                          db=0,
                                          decode_responses=True)
        entry = revoked_store.get(jti)
        logging.debug('token found %r' % (entry))

        if entry is None:
            return True
        if entry:
            return False
        return True

    except Exception as e:
        logging.error('connection redis failed with :%s' % (e))


if AppConfig.get_enable_cors():
    cors = CORS(server, resources={r"/api/*": {"origins": "*"}})

for blueprint in vars(routes).values():
    if isinstance(blueprint, Blueprint):
        server.register_blueprint(blueprint,
                                  url_prefix=AppConfig.get_api_url_prefix())


@server.route('/api/v1/info', methods=['GET'])
@jwt_required
def protected():
    return jsonify({
        'message': 'Welcome to User API version 1.0',
    }), 200