You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 28, 2022. It is now read-only.
I have an edge case in React Native where when a notification is clicked by a user, that navigates quickly to a specific screen, then if the app is backgrounded and the JWT token has already expired then that expired JWT token is used in that first request. Resulting in a "JWT token expired" error from Hasura.
I suspect this is due to auth.getJWTToken() pulls the JWT token from storage before it is updated or refreshed through the refresh token.
There are potential solutions to this that I can think of:
[Backward compatible] Expose a method to programmatically refresh the JWT Token with the refresh token, this will allow the client app to handle these errors by retrying the request after forcing a JWT Token refresh
[Potentially breaking change] Make it so that auth.getJWTToken() halts return, or returns null, until the JWT Token has been refreshed
Just my ideas above, might be other ways. Looking forward to hearing what your thoughts are on this one.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I have an edge case in React Native where when a notification is clicked by a user, that navigates quickly to a specific screen, then if the app is backgrounded and the JWT token has already expired then that expired JWT token is used in that first request. Resulting in a "JWT token expired" error from Hasura.
I suspect this is due to
auth.getJWTToken()
pulls the JWT token from storage before it is updated or refreshed through the refresh token.There are potential solutions to this that I can think of:
auth.getJWTToken()
halts return, or returns null, until the JWT Token has been refreshedJust my ideas above, might be other ways. Looking forward to hearing what your thoughts are on this one.
The text was updated successfully, but these errors were encountered: