diff --git a/bs/extension.py b/bs/extension.py index d2c4d41..062d9f9 100644 --- a/bs/extension.py +++ b/bs/extension.py @@ -23,7 +23,7 @@ # from __future__ import annotations import json -import datetime +from datetime import datetime, timezone from typing import Tuple from .expired_token_exception import ExpiredTokenException from .templates import bluescape_auth_function, bluescape_open_workspace_function, login_endpoint_page, refresh_ui_page, registration_endpoint_page @@ -100,7 +100,9 @@ class BluescapeUploadManager: def bluescape_status_endpoint(self): # Check whether token expired - now = math.trunc((datetime.datetime.utcnow()).timestamp()) + # The token expiration is in UTC, so we need to get the + # now in utc timezone as well + now = math.trunc(datetime.now(tz=timezone.utc).timestamp()) if self.state.token_exp is not None and now > self.state.token_exp: self.state.token_expired = True else: diff --git a/version.txt b/version.txt index 8cfbc90..8428158 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.1.1 \ No newline at end of file +1.1.2 \ No newline at end of file