Skip to content

Commit

Permalink
fix(pinterest): 🐛 make v3 get user info work well, and update the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
MerleLiuKun authored and pennersr committed Dec 28, 2022
1 parent 27f7f1c commit 2443c54
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
4 changes: 4 additions & 0 deletions allauth/socialaccount/providers/pinterest/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ class PinterestOAuth2Adapter(OAuth2Adapter):
profile_url = "https://{0}/{1}/user_account".format(
provider_base_url, provider_api_version
)
elif provider_api_version == "v3":
profile_url = "https://{0}/{1}/users/me".format(
provider_base_url, provider_api_version
)
else:
profile_url = "https://{0}/{1}/me".format(
provider_base_url, provider_api_version
Expand Down
23 changes: 18 additions & 5 deletions docs/providers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1689,26 +1689,39 @@ Pinterest

The Pinterest OAuth2 documentation:

# v1 # has been deprecated
https://developers.pinterest.com/docs/api/overview/#authentication

# v3 # plan to enforce an end of life on June 30, 2023.
https://developers.pinterest.com/docs/redoc/#section/User-Authorization

# v5
https://developers.pinterest.com/docs/getting-started/authentication/

You can optionally specify additional permissions to use. If no ``SCOPE``
value is set, the Pinterest provider will use ``read_public`` by default.
value is set, the Pinterest provider will use reading scope by default.

.. code-block:: python
SOCIALACCOUNT_PROVIDERS = {
'pinterest': {
'SCOPE': [
'read_public',
'read_relationships',
]
'SCOPE': ['user_accounts:read'],
"PINTEREST_VERSION": "v5",
}
}
SCOPE:
For a full list of scope options, see

# v1
https://developers.pinterest.com/docs/api/overview/#scopes

# v3
https://developers.pinterest.com/docs/redoc/#section/User-Authorization/OAuth-scopes

# v5
https://developers.pinterest.com/docs/getting-started/scopes/

Pocket
-------------

Expand Down

0 comments on commit 2443c54

Please sign in to comment.