Wraps a Flask handler to require a valid IndieAuth access token.

def requires_indieauth(f):
    """Wraps a Flask handler to require a valid IndieAuth access token.
    """
    @wraps(f)
    def decorated(*args, **kwargs):
        access_token = get_access_token()
        resp = check_auth(access_token)
        if isinstance(resp, Response):
          return resp
        return f(*args, **kwargs)
    return decorated