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
Hi, I am trying to use your package to build an personal project (GraphQL) and finding hard to implement a refresh process. Using Dio I could block the client so all the subsequence requests goes to a queue (using Queuedinterceptor), refresh and then queue is processed. Using your package, do I need to implement something like that by myself?
Right now I am using AuthLink which is in your case passing by custom class GraphQLToken :
Unfortunately currently for the workaround, I have updated the API to return an expires_at time stamp. So, I can check to see if the token is expired before setting the header. If it is, then refresh the token, attach it, and then make the request.
It's not ideal, since tokens can expire for other reasons (like token expiring at the time of request and response is 401), so a true solution using the stream would definitely be preferable. Thanks in advance.
The text was updated successfully, but these errors were encountered:
iamnabink
changed the title
[Auth] How to re-request an operation with new headers (refresh token)?
[Auth-Graphql] How to re-request an operation with new headers (refresh token)?
Feb 22, 2024
Hi, I am trying to use your package to build an personal project (
GraphQL
) and finding hard to implement a refresh process. Using Dio I could block the client so all the subsequence requests goes to a queue (usingQueuedinterceptor
), refresh and then queue is processed. Using your package, do I need to implement something like that by myself?Right now I am using
AuthLink
which is in your case passing by custom classGraphQLToken
:Unfortunately currently for the workaround, I have updated the API to return an expires_at time stamp. So, I can check to see if the token is expired before setting the header. If it is, then refresh the token, attach it, and then make the request.
It's not ideal, since tokens can expire for other reasons (like token expiring at the time of request and response is 401), so a true solution using the stream would definitely be preferable. Thanks in advance.
The text was updated successfully, but these errors were encountered: