-
Notifications
You must be signed in to change notification settings - Fork 19
Description
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 :
GraphQLToken(builder: () async {
final token = await getAccessToken();
return `Bearer $token`
},
);
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.