Hi, thanks for posting the token refresh solution in and detailing it in your blog post Add Google Login to your React Apps in 10 mins.
One question/comment:
The timer solution works well if the user keeps the browser open. Expired JWTs are refreshed as expected. However, as far as I can tell this doesn't address the following scenario:
- User logs in via browser. This starts the refresh timer and we are able to refresh the token as long as the browser remains open. Nice!
- User closes browser
- User later re-opens the browser and navigates to our app
- We retrieve the authToken from localStorage
At this point, we have an expired JWT but no reference to the original Google response (initially received from via onSuccess callback when we logged in prior to closing the browser). Without it we cannot call res.reloadAuthResponse() to retrieve a new token.
Is my analysis correct, or am I missing something in my understanding? Thanks!
Hi, thanks for posting the token refresh solution in and detailing it in your blog post Add Google Login to your React Apps in 10 mins.
One question/comment:
The timer solution works well if the user keeps the browser open. Expired JWTs are refreshed as expected. However, as far as I can tell this doesn't address the following scenario:
At this point, we have an expired JWT but no reference to the original Google response (initially received from via onSuccess callback when we logged in prior to closing the browser). Without it we cannot call res.reloadAuthResponse() to retrieve a new token.
Is my analysis correct, or am I missing something in my understanding? Thanks!