wp-graphql / wp-graphql-jwt-authentication

Authentication for WPGraphQL using JWT (JSON Web Tokens)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Token expiration should be included on `refreshJwtAuthToken` mutation response

etoler1841 opened this issue · 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?

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