Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only update refresh_token if it was returned in the response #43

Merged
merged 1 commit into from
Mar 3, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Only update refresh_token if it was returned in the response
It is not returned with renewals of the id and access token (which the
documentation did not make clear).
  • Loading branch information
tsibley committed Mar 2, 2021
commit 60a422b7899b6feeef932d8204d40c0453a4605c
3 changes: 2 additions & 1 deletion pycognito/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,8 @@ def _set_tokens(self, tokens):
AuthenticationResult.
"""
self.verify_token(tokens["AuthenticationResult"]["IdToken"], "id_token", "id")
self.refresh_token = tokens["AuthenticationResult"]["RefreshToken"]
if "RefreshToken" in tokens["AuthenticationResult"]:
self.refresh_token = tokens["AuthenticationResult"]["RefreshToken"]
self.verify_token(
tokens["AuthenticationResult"]["AccessToken"], "access_token", "access"
)
Expand Down