From 81a8136f0844e43b1d0ce1059b1263fc9fd53d5b Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Wed, 15 Jan 2025 09:50:29 -0600 Subject: Allow non-expiring JWTs The authorisation server was updated to return non-expiring JWTs, so this particular client needs to allow for such. --- uploader/oauth2/client.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'uploader/oauth2') 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 -- cgit v1.2.3