aboutsummaryrefslogtreecommitdiff
path: root/uploader/oauth2
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2025-01-15 09:50:29 -0600
committerFrederick Muriuki Muriithi2025-01-15 09:50:29 -0600
commit81a8136f0844e43b1d0ce1059b1263fc9fd53d5b (patch)
treedfeb10617c4fe4f7e92d06ad75f3d4c7b3e01955 /uploader/oauth2
parentafa197ebd1bdd8c92aedc9c33a1cc653398c35bf (diff)
downloadgn-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.py3
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