Skip to content

Commit

Permalink
Fixed UTC conversion failed in GH test
Browse files Browse the repository at this point in the history
  • Loading branch information
miballe committed Aug 30, 2024
1 parent 176c98d commit 491bf0c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/factiva/analytics/auth/oauthuser.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def get_id_token(self) -> bool:
self._access_token = response_body['access_token']
bearer_payload = eval(base64.b64decode(self._access_token.split('.')[1] + '==').decode('utf-8'))
# self._id_expiration = datetime.datetime.utcfromtimestamp(int(bearer_payload['exp'])).replace(tzinfo=datetime.timezone.utc)
self._id_expiration = datetime.datetime.fromtimestamp(int(bearer_payload['exp']), datetime.UTC)
self._id_expiration = datetime.datetime.fromtimestamp(int(bearer_payload['exp']), datetime.timezone.utc)
return True
elif authn_response.status_code == 403:
raise PermissionError('Invalid user credentials')
Expand Down Expand Up @@ -234,7 +234,7 @@ def get_jwt_token(self) -> bool:
self._jwt_token = response_body["access_token"]
bearer_payload = eval(base64.b64decode(self._jwt_token.split('.')[1] + '==').decode('utf-8'))
# self._jwt_expiration = datetime.datetime.utcfromtimestamp(int(bearer_payload['exp'])).replace(tzinfo=datetime.timezone.utc)
self._jwt_expiration = datetime.datetime.fromtimestamp(int(bearer_payload['exp']), datetime.UTC)
self._jwt_expiration = datetime.datetime.fromtimestamp(int(bearer_payload['exp']), datetime.timezone.utc)
return True


Expand Down

0 comments on commit 491bf0c

Please sign in to comment.