Tigge / antfs-cli

Extracts FIT files from ANT-FS based sport watches such as Garmin Forerunner 60, 405CX, 310XT, 610 and 910XT.
MIT License
312 stars 77 forks source link

Refresh Strava OAuth token before uploading #178

Closed pwithnall closed 4 years ago

pwithnall commented 5 years ago

Currently the Strava upload script seems to assume it has a ‘forever’ OAuth token from Strava, but Strava’s now migrated away from that. OAuth tokens expire after 6 hours, and you need to do a POST request to refresh them, using a refresh code provided in response to the initial auth request.

https://developers.strava.com/docs/authentication/#refresh-expired-access-tokens

It would be good if 40-upload_to_strava.py supported that, since it currently fails all uploads done more than 6 hours after the previous one.

mscansian commented 4 years ago

Hi, I submitted a patch that should fix this. It just runs the auth flow if your token is logged of. I understand that this may be a bit annoying, but it's the easiest I could do to get it working.

I'm starting to use Strava again after almost a year and if I see that this is too much of a hassle I will probably think on a better solution.

EDIT: I just saw that you have a much more complete PR that has not been merged yet.

Tigge commented 4 years ago

Should be fixed in #180.