Exemple #1
0
    def decorated_function(*args, **kwargs):

        token = request.args.get('token', None)

        if token is None:
            abort(401)

        validation = oauth2db.check_token(token)
        if not validation["success"]:
            abort(401)

        return function_to_decorate(*args, **kwargs)
Exemple #2
0
    def decorated_function(*args, **kwargs):

        token = request.args.get('token', None)

        if token is None:
            abort(401)

        validation = oauth2db.check_token(token)
        if not validation["success"]:
            abort(401)

        return function_to_decorate(*args, **kwargs)
Exemple #3
0
    def decorated_function(*args, **kwargs):

        if not "token" in request.json:
            abort(401)

        token = request.json['token']

        validation = oauth2db.check_token(token)
        if not validation["success"]:
            abort(401)

        return function_to_decorate(*args, **kwargs)
Exemple #4
0
    def decorated_function(*args, **kwargs):

        if not "token" in request.json:
            abort(401)

        token = request.json['token']

        validation = oauth2db.check_token(token)
        if not validation["success"]:
            abort(401)

        return function_to_decorate(*args, **kwargs)