strava prepare for their update
This commit is contained in:
@@ -122,6 +122,13 @@ def imports_do_refresh_token(refreshtoken,oauth_data,access_token=''):
|
|||||||
'Accept': 'application/json',
|
'Accept': 'application/json',
|
||||||
'Content-Type': oauth_data['content_type']}
|
'Content-Type': oauth_data['content_type']}
|
||||||
|
|
||||||
|
# for Strava
|
||||||
|
if 'grant_type' in oauth_data:
|
||||||
|
if oauth_data['grant_type']:
|
||||||
|
post_data['grant_type'] = oauth_data['grant_type']
|
||||||
|
else:
|
||||||
|
grant_type = post_data.pop('grant_type',None)
|
||||||
|
|
||||||
if oauth_data['bearer_auth']:
|
if oauth_data['bearer_auth']:
|
||||||
headers['authorization'] = 'Bearer %s' % access_token
|
headers['authorization'] = 'Bearer %s' % access_token
|
||||||
|
|
||||||
@@ -193,6 +200,13 @@ def imports_get_token(
|
|||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'user-agent': 'sanderroosendaal'}
|
'user-agent': 'sanderroosendaal'}
|
||||||
|
|
||||||
|
if 'grant_type' in oauth_data:
|
||||||
|
if oauth_data['grant_type']:
|
||||||
|
post_data['grant_type'] = oauth_data['grant_type']
|
||||||
|
else:
|
||||||
|
grant_type = post_data.pop('grant_type',None)
|
||||||
|
|
||||||
|
|
||||||
if 'json' in oauth_data['content_type']:
|
if 'json' in oauth_data['content_type']:
|
||||||
response = requests.post(
|
response = requests.post(
|
||||||
base_uri,
|
base_uri,
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ oauth_data = {
|
|||||||
'expirydatename': '',
|
'expirydatename': '',
|
||||||
'bearer_auth': True,
|
'bearer_auth': True,
|
||||||
'base_url': "https://www.strava.com/oauth/token",
|
'base_url': "https://www.strava.com/oauth/token",
|
||||||
|
'grant_type': None,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user