def auth()

in pantri/scripts/pantri.py [0:0]


def auth(options) -> bool:
    """Set up auth and nothing else."""
    objectStore = FB_ObjectStore(options)
    if options.get("test", False):
        # If we only care if it's valid, just check and leave
        auth_token = objectStore.get_cached_auth_token()
        # Validate and return cached auth token.
        if auth_token and objectStore.validate_auth_token(auth_token):
            logging.getLogger("pantri").info("Auth token is valid.")
            return True
        logging.getLogger("pantri").info("Auth token is invalid.")
        return False
    objectStore.get_auth_token()
    logging.getLogger("pantri").info("Auth token is valid.")
    return True