Open ianbarker opened 5 years ago
Hey Ian! Thanks for taking the time to put together this PR. I think this will make a great addition to the library! 😄
Could we implement this a slightly different way?
You can get the expiration date from the JWT by:
"."
character. The 2nd part contains our JWT payload."exp"
key contains the token expiration, which can be stored and checked against.Cheers, and let me know if there's anything I can help with!
Ok, good idea. I'll make those changes and update the PR
Ok, I've updated the PR so that the token will refresh using the exp property of the JWT payload.
I've noticed that a long running app's token will expire. The API docs state that the token lasts for 24h so this PR should allow a refresh every 12 hours thus stopping it expiring.