Closed kocur4d closed 5 years ago
I am aware that there are few similar issues but they are left unanswered.
My use case is that I would like to check for a token valid on every graphql call I am making:
const auth = getAuth() const user = auth.getCachedSession() if(!user.isValid()) auth.refreshSession(auser.getRefreshToken().getToken()) const session = auth.getSignInUserSession() const token = session.getIdToken().getJwtToken()
But this doesn't work after an hour I am getting:
This call fails with 'Invalid JWT Token - TokenExpiredError: jwt expired' from my server and the token gets updated for a next call.
'Invalid JWT Token - TokenExpiredError: jwt expired'
awaiting auth.refreshSession() doesn't do anything and checking the source indeed confirms the need for auth.userhandler onSuccess method.
awaiting
auth.refreshSession()
auth.userhandler
onSuccess
How can you go around it? I would like to only check, if token is valid, and update it when making calls that are using them.
Hello @kocur4d how did you handle the token refresh?
I am aware that there are few similar issues but they are left unanswered.
My use case is that I would like to check for a token valid on every graphql call I am making:
But this doesn't work after an hour I am getting:
This call fails with
'Invalid JWT Token - TokenExpiredError: jwt expired'
from my server and the token gets updated for a next call.awaiting
auth.refreshSession()
doesn't do anything and checking the source indeed confirms the need forauth.userhandler
onSuccess
method.How can you go around it? I would like to only check, if token is valid, and update it when making calls that are using them.