diff --git a/sso/fitbit.py b/sso/fitbit.py index 4cb54964..e87b078d 100644 --- a/sso/fitbit.py +++ b/sso/fitbit.py @@ -42,10 +42,11 @@ def __init__( self.user_info = self.get_user_info() def get_new_token(self): + decoded_token = base64.b64encode(f"{self.client_id}:{self.client_secret}".encode()).decode() response = requests.post( "https://api.fitbit.com/oauth2/token", headers={ - "Authorization": f"Basic {base64.b64encode(f'{self.client_id}:{self.client_secret}'.encode()).decode()}", + "Authorization": f"Basic {decoded_token}", "Content-Type": "application/x-www-form-urlencoded", }, data={ diff --git a/sso/formstack.py b/sso/formstack.py index 0f7be7be..4268de53 100644 --- a/sso/formstack.py +++ b/sso/formstack.py @@ -21,6 +21,7 @@ - formstack:write """ + class FormstackSSO: def __init__( self, @@ -74,7 +75,9 @@ def get_user_info(self): ) def send_form_submission(self, form_id, submission_data): - form_submission_url = f"https://www.formstack.com/api/v2/form/{form_id}/submission.json" + form_submission_url = ( + f"https://www.formstack.com/api/v2/form/{form_id}/submission.json" + ) headers = { "Authorization": f"Bearer {self.access_token}", "Content-Type": "application/json", diff --git a/sso/paypal.py b/sso/paypal.py index 7c3d868a..722e3e65 100644 --- a/sso/paypal.py +++ b/sso/paypal.py @@ -36,10 +36,11 @@ def __init__( self.user_info = self.get_user_info() def get_new_token(self): + token = base64.b64encode(f"{self.client_id}:{self.client_secret}".encode()).decode() response = requests.post( "https://api.paypal.com/v1/oauth2/token", headers={ - "Authorization": f"Basic {base64.b64encode(f'{self.client_id}:{self.client_secret}'.encode()).decode()}", + "Authorization": f"Basic {token}", "Content-Type": "application/x-www-form-urlencoded", }, data={