vue-google-auth icon indicating copy to clipboard operation
vue-google-auth copied to clipboard

Refresh token

Open robinandeer opened this issue 7 years ago • 0 comments

Since the token is only valid for 1 hour it would be nice to include an option or perhaps by default reload expired tokens in exchange for fresh ones. I'm not entirely sure how to best implement this but this is what I'm testing out in my app:

setInterval(() => {
  window.gapi.auth2.getAuthInstance().currentUser.get().reloadAuthResponse().then((authRes) => {
    console.log('refreshing token')
     // app logic...
}, 3600000)

I'd be willing to take a look at it after I see that it works and open a PR later

robinandeer avatar Sep 01 '17 14:09 robinandeer