Skip to content

Commit

Permalink
Merge branch 'main' into djperrefort-patch-2
Browse files Browse the repository at this point in the history
  • Loading branch information
djperrefort authored Jul 23, 2024
2 parents 37a40e8 + fa77ee2 commit 7741b0f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions keystone_client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,13 +315,13 @@ def login(self, username: str, password: str, timeout: int = default_timeout) ->
response.raise_for_status()

# Parse data from the refresh token
refresh_payload = jwt.decode(self._refresh_token)
self._refresh_token = response.json().get("refresh")
refresh_payload = jwt.decode(self._refresh_token, options={"verify_signature": False}, algorithms='HS256')
self._refresh_expiration = datetime.fromtimestamp(refresh_payload["exp"])

# Parse data from the access token
access_payload = jwt.decode(self._access_token)
self._access_token = response.json().get("access")
access_payload = jwt.decode(self._access_token, options={"verify_signature": False}, algorithms='HS256')
self._access_expiration = datetime.fromtimestamp(access_payload["exp"])

def logout(self, timeout: int = default_timeout) -> None:
Expand Down Expand Up @@ -376,6 +376,7 @@ def _refresh_tokens(self, force: bool = True, timeout: int = default_timeout) ->
)

response.raise_for_status()
refresh_payload = jwt.decode(self._refresh_token)
self._refresh_token = response.json().get("refresh")
refresh_payload = jwt.decode(self._refresh_token, options={"verify_signature": False}, algorithms='HS256')
self._refresh_expiration = datetime.fromtimestamp(refresh_payload["exp"])

0 comments on commit 7741b0f

Please sign in to comment.