jlouder / garmin-connect-perl

Perl module for accessing Garmin Connect data
2 stars 3 forks source link

Save access token; add _api method; add profile method #7

Closed noduck closed 11 months ago

noduck commented 11 months ago

Hi,

Please consider these changes:

Best!

jlouder commented 11 months ago

Does this cache the token forever? I couldn't see where we decide if the token is too old.

The call that gives us access_token gives an expiration, too. There's an expires_in property that is a number (seconds, I'm guessing?).

If we are going to cache the access token, I think we need to be able to detect when it's no longer valid and get a new one.

jlouder commented 11 months ago

I saw the comment you added to the issue about this: the code will use the token until it fails, then generate a new one. That seems good enough, and quite simple.

I'll merge this PR and make a new release later this week.

Thank you for contributing!