Understanding refresh token mechanism #8185
Unanswered
mateuszwojt
asked this question in
Question
Replies: 1 comment
-
You need to refresh with Apollo has Links which you can use to intercept the request before it reaches Hasura, this is where I exchange tokens if the access token is expired. I think there's a way to do it with URQL urql-graphql/urql#2062 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to set up a token refresh mechanism using a mutation. My code is loosely based on jwt-guide, but I'm using URQL instead of Apollo as a client.
Here I submit the refresh token and user fingerprint and get back a JWT token:
but the exchange where this refresh mutation is triggered happens obviously when the current JWT expires. My problem is that in my request I'm sending the Authorization header, and Hasura doesn't let me run this operation because the token in the header is expired. Is there something I'm missing in the configuration of Hasura action? Should I get rid of the Authorization header when refreshing the token? What's the correct approach?
Beta Was this translation helpful? Give feedback.
All reactions