Skip to content

Commit

Permalink
fix: bring old logic back
Browse files Browse the repository at this point in the history
  • Loading branch information
yihong0618 committed Oct 21, 2023
1 parent 386fa32 commit 34c859e
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions run_page/nike_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,19 @@ class Nike:
def __init__(self, refresh_token):
self.client = httpx.Client()

# response = self.client.post(
# TOKEN_REFRESH_URL,
# json={
# "refresh_token": refresh_token,
# "client_id": NIKE_CLIENT_ID,
# "grant_type": "refresh_token",
# },
# timeout=60,
# )
# response.raise_for_status()

# access_token = response.json()["access_token"]
# self.client.headers.update({"Authorization": f"Bearer {access_token}"})
self.client.headers.update({"Authorization": f"Bearer {refresh_token}"})
response = self.client.post(
TOKEN_REFRESH_URL,
json={
"refresh_token": refresh_token,
"client_id": NIKE_CLIENT_ID,
"grant_type": "refresh_token",
},
timeout=60,
)
response.raise_for_status()

access_token = response.json()["access_token"]
self.client.headers.update({"Authorization": f"Bearer {access_token}"})

def get_activities_since_timestamp(self, timestamp):
return self.request("activities/after_time", timestamp)
Expand Down

1 comment on commit 34c859e

@vercel
Copy link

@vercel vercel bot commented on 34c859e Oct 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

running-page – ./

running-page-git-master-yihong0618.vercel.app
running-page.vercel.app
running-page-yihong0618.vercel.app

Please sign in to comment.