From fed69a4a2b724d4fe466bc68af6e7749f97fd5b8 Mon Sep 17 00:00:00 2001 From: dfana Date: Mon, 21 Nov 2022 19:38:46 -0400 Subject: [PATCH 1/2] fix: add configuration param key to PinterestSDKClient.create_client_with_refresh_token and PinterestSDKClient.create_client_with_token --- pinterest/client/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pinterest/client/__init__.py b/pinterest/client/__init__.py index dab6bea..9d9231e 100644 --- a/pinterest/client/__init__.py +++ b/pinterest/client/__init__.py @@ -58,12 +58,12 @@ def __init__(self, access_token=None, refresh_token=None, app_id=None, app_secre def create_client_with_refresh_token(cls, refresh_token: str, app_id: str, app_secret: str): """Get a new SDK client with the given refresh token, app id and app secret.""" access_token = cls._get_access_token(refresh_token, app_id, app_secret) - return PinterestSDKClient(cls._get_config(access_token)) + return PinterestSDKClient(configuration=cls._get_config(access_token)) @classmethod def create_client_with_token(cls, access_token: str): """Get a new SDK client with the given access token.""" - return PinterestSDKClient(cls._get_config(access_token)) + return PinterestSDKClient(configuration=cls._get_config(access_token)) @classmethod def set_default_client(cls, client): From 88dabc41224279e4c6c56f67489d27a269b290b8 Mon Sep 17 00:00:00 2001 From: dfana Date: Mon, 21 Nov 2022 21:52:52 -0400 Subject: [PATCH 2/2] fix: authentication wrong variables order --- pinterest/client/__init__.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/pinterest/client/__init__.py b/pinterest/client/__init__.py index 9d9231e..1cca502 100644 --- a/pinterest/client/__init__.py +++ b/pinterest/client/__init__.py @@ -57,13 +57,25 @@ def __init__(self, access_token=None, refresh_token=None, app_id=None, app_secre @classmethod def create_client_with_refresh_token(cls, refresh_token: str, app_id: str, app_secret: str): """Get a new SDK client with the given refresh token, app id and app secret.""" - access_token = cls._get_access_token(refresh_token, app_id, app_secret) - return PinterestSDKClient(configuration=cls._get_config(access_token)) + access_token = cls._get_access_token( + refresh_token=refresh_token, + app_id=app_id, + app_secret=app_secret + ) + return PinterestSDKClient( + configuration=cls._get_config( + access_token=access_token + ) + ) @classmethod def create_client_with_token(cls, access_token: str): """Get a new SDK client with the given access token.""" - return PinterestSDKClient(configuration=cls._get_config(access_token)) + return PinterestSDKClient( + configuration=cls._get_config( + access_token=access_token + ) + ) @classmethod def set_default_client(cls, client):