wp-graphql-jwt-authentication icon indicating copy to clipboard operation
wp-graphql-jwt-authentication copied to clipboard

Token expiration should be included on `refreshJwtAuthToken` mutation response

Open etoler1841 opened this issue 5 years ago • 1 comments

As has been mentioned in a few other issues, when a request is made with an expired token, it would be helpful to get an "Expired token" message back. But ideally, it makes more sense to track a token's expiration and to go ahead and refresh it before making a new request if we already know the token is expired. The login mutation already has a jwtAuthExpiration field; can the same be added to the refreshJwtAuthToken mutation?

etoler1841 avatar Dec 10 '20 19:12 etoler1841

Was looking for this too. As a workaround I'm using the polling feature of Apollo to just have it refresh every 280 seconds.

Edit: Sorry it's late, I'm not using that api since it doesn't work on mutations 🤦 , meant to say I'm using a custom polling method. Same idea though

dawnerd avatar Apr 11 '21 04:04 dawnerd