diff options
author | Frederick Muriuki Muriithi | 2025-01-15 09:50:29 -0600 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2025-01-15 09:50:29 -0600 |
commit | 81a8136f0844e43b1d0ce1059b1263fc9fd53d5b (patch) | |
tree | dfeb10617c4fe4f7e92d06ad75f3d4c7b3e01955 /uploader/oauth2 | |
parent | afa197ebd1bdd8c92aedc9c33a1cc653398c35bf (diff) | |
download | gn-uploader-81a8136f0844e43b1d0ce1059b1263fc9fd53d5b.tar.gz |
Allow non-expiring JWTs
The authorisation server was updated to return non-expiring JWTs, so
this particular client needs to allow for such.
Diffstat (limited to 'uploader/oauth2')
-rw-r--r-- | uploader/oauth2/client.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/uploader/oauth2/client.py b/uploader/oauth2/client.py index e7128de..1efa299 100644 --- a/uploader/oauth2/client.py +++ b/uploader/oauth2/client.py @@ -112,7 +112,8 @@ def oauth2_client(): try: jwt = JsonWebToken(["RS256"]).decode( token["access_token"], key=jwk) - return datetime.now().timestamp() > jwt["exp"] + if bool(jwt.get("exp")): + return datetime.now().timestamp() > jwt["exp"] except BadSignatureError as _bse: pass |