How to refresh expired google sign-in logins?

前端 未结 5 2241
借酒劲吻你
借酒劲吻你 2020-12-07 22:51

I\'m using Google Sign-In. A user comes to my site and logs in with gapi.auth2.getAuthInstance().signIn(), or they are already logged in and when the page loads

5条回答
  •  生来不讨喜
    2020-12-07 23:12

    FWIW, we've managed to (mostly) make it work via a listener approach. It appears that 'userChanged' callback is invoked ~5 minutes before the access token expires. That's enough for us to extract and update the access token without refreshing the page.

    What does not quite work though is when computer comes back from sleep. This can be solved relatively easy by reloading the page on wake up.

提交回复
热议问题