I'm using the <GoogleLogin> component to get a JWT. I store that JWT in my sate and then with each request to my backend i send the JWT along. My backend then validates the JWT using the OAuth2Client from 'google-auth-library' before performing any other actions:
After the expiration of the initial JWT from clicking the button from the GoogleLogin component, all my future requests to my backend are invalidated (as the token is expired).
Is there a way for me to prompt the user for another sign-in automatically for a new JWT? Or some other way while using the <GoogleLogin> component to prevent getting stuck in this situation where the user has to manually click the GoogleLogin button again?
Hi
I'm using the
<GoogleLogin>
component to get a JWT. I store that JWT in my sate and then with each request to my backend i send the JWT along. My backend then validates the JWT using theOAuth2Client
from 'google-auth-library' before performing any other actions:After the expiration of the initial JWT from clicking the button from the GoogleLogin component, all my future requests to my backend are invalidated (as the token is expired).
Is there a way for me to prompt the user for another sign-in automatically for a new JWT? Or some other way while using the
<GoogleLogin>
component to prevent getting stuck in this situation where the user has to manually click the GoogleLogin button again?