Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle Harvest auth token expiration. #10

Open
jgerigmeyer opened this issue Nov 7, 2019 · 2 comments
Open

Handle Harvest auth token expiration. #10

jgerigmeyer opened this issue Nov 7, 2019 · 2 comments

Comments

@jgerigmeyer
Copy link
Member

Pulling up a Trello board today, I noticed the reports weren't loading. Inspecting the XHR requests, I saw that all requests to Harvest were returning with 401 "token invalid or expired".

  1. How long do the auth tokens to Harvest last? If they expire automatically, can we prevent that?
  2. If not, can we handle expiration in a more robust way -- at the very least alerting the user?
@carljm
Copy link
Member

carljm commented Nov 8, 2019

Yeah, this needs to be handled better. The auth flow we are using is described at https://help.getharvest.com/api-v2/authentication-api/authentication/authentication/#for-client-side-applications so Harvest does give us the expiry time, we just currently aren't doing anything with it. At some point we need to just tell the user "you need to re-authorize, here's a link to do it." I kind of feel like regardless we should fall back to that whenever we see our API requests failing. Though I guess the ideal might be to also store the expiry time and if we notice it's coming up within a day (?), show a link to re-authorize along with the time data or something.

I don't see any way to extend or avoid the token expiration, which isn't surprising since ultimately it's a security concern for Harvest.

@jgerigmeyer
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants