diff --git a/cbpro/public_client.py b/cbpro/public_client.py index e854a163..64f387b5 100644 --- a/cbpro/public_client.py +++ b/cbpro/public_client.py @@ -265,6 +265,10 @@ def _send_message(self, method, endpoint, params=None, data=None): """ url = self.url + endpoint + if self.auth is not None and not all([ + self.auth.api_key, self.auth.passphrase, self.auth.secret_key, + ]): + self.auth = None r = self.session.request(method, url, params=params, data=data, auth=self.auth, timeout=30) return r.json() @@ -295,6 +299,11 @@ def _send_paginated_message(self, endpoint, params=None): if params is None: params = dict() url = self.url + endpoint + + if self.auth is not None and not all([ + self.auth.api_key, self.auth.passphrase, self.auth.secret_key, + ]): + self.auth = None while True: r = self.session.get(url, params=params, auth=self.auth, timeout=30) results = r.json()