aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--pyfunkwhale/client.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/pyfunkwhale/client.py b/pyfunkwhale/client.py
index 95907f7..53e7a66 100644
--- a/pyfunkwhale/client.py
+++ b/pyfunkwhale/client.py
@@ -123,6 +123,11 @@ class Client(object):
r = call(self.domain + '/api/v1/' + endpoint, headers=headers,
params=params, data=data)
+ if r.status_code == 401:
+ self._force_refresh_token()
+ r = call(self.domain + '/api/v1/' + endpoint, headers=headers,
+ params=params, data=data)
+
r.raise_for_status()
return r