def requires_auth(f):
@wraps(f)<EOL>def requires_auth_decorator(*args, **kwargs):<EOL><INDENT>try:<EOL><INDENT>authenticate_http_request()<EOL><DEDENT>except PyMacaronException as e:<EOL><INDENT>return e.http_reply()<EOL><DEDENT>return f(*args, **kwargs)<EOL><DEDENT>return requires_auth_decorator<EOL>
A decorator for flask api methods that validates auth0 tokens, hence ensuring
    that the user is authenticated. Code coped from:
    https://github.com/auth0/auth0-python/tree/master/examples/flask-api