fixed polar auth
This commit is contained in:
@@ -75,14 +75,16 @@ def get_token(code):
|
||||
|
||||
try:
|
||||
headers = { 'Authorization': 'Basic %s' % base64.b64encode(auth_string) }
|
||||
print(headers,'aa')
|
||||
except TypeError:
|
||||
headers = { 'Authorization': 'Basic %s' % base64.b64encode(bytes(auth_string,'utf-8')) }
|
||||
headers = { 'Authorization': 'Basic %s' % base64.b64encode(
|
||||
bytes(auth_string,'utf-8')).decode('utf-8') }
|
||||
|
||||
response = requests.post("https://polarremote.com/v2/oauth2/token",
|
||||
data=post_data,
|
||||
headers=headers)
|
||||
|
||||
|
||||
|
||||
try:
|
||||
token_json = response.json()
|
||||
thetoken = token_json['access_token']
|
||||
|
||||
BIN
rowers/tests/testdata/testdata.csv.gz
vendored
BIN
rowers/tests/testdata/testdata.csv.gz
vendored
Binary file not shown.
@@ -697,8 +697,6 @@ def rower_process_polarcallback(request):
|
||||
|
||||
return HttpResponseRedirect(url)
|
||||
|
||||
|
||||
|
||||
access_token, expires_in, user_id = polarstuff.get_token(code)
|
||||
|
||||
expirydatetime = timezone.now()+datetime.timedelta(seconds=expires_in)
|
||||
|
||||
Reference in New Issue
Block a user