diff options
author | neodarz <neodarz@neodarz.net> | 2020-04-12 11:15:24 +0200 |
---|---|---|
committer | neodarz <neodarz@neodarz.net> | 2020-04-12 11:15:24 +0200 |
commit | 9ab6caef3c048b254b55fae422c64ebafd330296 (patch) | |
tree | aabf4945f2c443878273026c85e6af32f094c4ff | |
parent | 9547b163e3c3c717cb465c8f4019d9b107df0b63 (diff) | |
download | pyfunkwhale-9ab6caef3c048b254b55fae422c64ebafd330296.tar.xz pyfunkwhale-9ab6caef3c048b254b55fae422c64ebafd330296.zip |
Force refersh token if it invalid when calling the API
Diffstat (limited to '')
-rw-r--r-- | pyfunkwhale/client.py | 5 |
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 |