token refresh works
This commit is contained in:
@@ -88,7 +88,7 @@ def custom_exception_handler(exc,message):
|
||||
return res
|
||||
|
||||
# Refresh ST token using refresh token
|
||||
def do_refresh_token(refreshtoken):
|
||||
def do_refresh_token(refreshtoken,access_token):
|
||||
client_auth = requests.auth.HTTPBasicAuth(UNDERARMOUR_CLIENT_KEY, UNDERARMOUR_CLIENT_SECRET)
|
||||
post_data = {"grant_type": "refresh_token",
|
||||
"client_secret": UNDERARMOUR_CLIENT_SECRET,
|
||||
@@ -98,12 +98,13 @@ def do_refresh_token(refreshtoken):
|
||||
headers = {'user-agent': 'sanderroosendaal',
|
||||
"Api-Key":UNDERARMOUR_CLIENT_KEY,
|
||||
'Accept': 'application/json',
|
||||
'Content-Type': 'application/json'}
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'authorization': 'Bearer %s' % access_token}
|
||||
|
||||
url = "https://api.ua.com/v7.1/oauth2/access_token"
|
||||
url = "https://api.ua.com/v7.1/oauth2/access_token/"
|
||||
|
||||
response = requests.post(url,
|
||||
data=json.dumps(post_data),
|
||||
data=post_data,
|
||||
headers=headers)
|
||||
|
||||
token_json = response.json()
|
||||
|
||||
Reference in New Issue
Block a user