diff options
author | neodarz <neodarz@neodarz.net> | 2021-01-31 22:47:15 +0100 |
---|---|---|
committer | neodarz <neodarz@neodarz.net> | 2021-01-31 22:47:15 +0100 |
commit | e30d15ea4a1276345d8ef7691bf3d2d83a8c302f (patch) | |
tree | 8cd1a6deb6d831ab87b6f9e5427f0f6177c361a8 | |
parent | 20c80a82776bbea6a47b77a47f6a0587cc416ae8 (diff) | |
download | pyfunkwhale-e30d15ea4a1276345d8ef7691bf3d2d83a8c302f.tar.xz pyfunkwhale-e30d15ea4a1276345d8ef7691bf3d2d83a8c302f.zip |
Raise an error if no token when trying to refresh
-rw-r--r-- | pyfunkwhale/client.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/pyfunkwhale/client.py b/pyfunkwhale/client.py index bebb271..7343e94 100644 --- a/pyfunkwhale/client.py +++ b/pyfunkwhale/client.py @@ -113,6 +113,8 @@ class Client(object): Check if the token is expired in 60 seconds and if True will ask a new token from the instance. """ + if self.token is None: + raise InvalidTokenError(self) if time() - 60 > self.token["expires_at"]: try: self.token = self.oauth_client.refresh_token( |