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

BUG - Fetching new access token breaks python code on 401 #114

Closed
gbadnmo opened this issue Aug 24, 2023 · 1 comment
Closed

BUG - Fetching new access token breaks python code on 401 #114

gbadnmo opened this issue Aug 24, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@gbadnmo
Copy link

gbadnmo commented Aug 24, 2023

Describe the bug

A clear and concise description of what the bug is.

To Reproduce

Executing the following code where the refresh token is invalid or has the wrong grants

refresh_token = 'pinr.<REDACTED>'
client_id = '<REDACTED>'
client_secret = '<REDACTED>'

from pinterest.client import PinterestSDKClient
client = PinterestSDKClient.create_client_with_refresh_token(refresh_token, app_id=client_id, app_secret=client_secret)

Yields the error :
AttributeError: 'HTTPResponse' object has no attribute 'body'. Did you mean: '_body'?

Expected behavior

It should throw an error the SdkException in pinterest.utils.refresh_access_token.get_new_access_token with b'{"code":283,"message":"The authorization grant is invalid"}'

Screenshots

Additional Details (please complete the following information):

  • OS and Version: Linux
  • SDK Version v0.2.1

Additional Context

@Igosuki
Copy link

Igosuki commented Dec 8, 2023

Thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants