def auth()

in src/mapillary/utils/auth.py [0:0]


def auth():
    """Wrap interface functions with logic for Client"""

    def auth_decorator(f):
        """Decorator function"""

        @wraps(f)
        def wrapper(*args, **kwargs):
            """
            :param args: Function arguments
            :param kwargs: Key word arguments
            :return: Return the specified function with args, kwargs
            """

            if Client.get_token() == "":
                # If empty, raise exception
                raise AuthError("Function called without setting the access token")

            # Return function called with arguments
            return f(*args, **kwargs)

        # Return wrapper
        return wrapper

    # Return decorator
    return auth_decorator