Before making any request, the authentication library I use checks whether its current access token is valid and, if it is not, makes an API call to refresh the access token. Naturally this is an asynchronous process.
It'd be swell if onRequest (and onResponse too, I suppose, for good measure) supported async callbacks! That's the natural place to inject the authentication information, but since those functions are synchronous that doesn't work right now.
Before making any request, the authentication library I use checks whether its current access token is valid and, if it is not, makes an API call to refresh the access token. Naturally this is an asynchronous process.
It'd be swell if
onRequest
(andonResponse
too, I suppose, for good measure) supportedasync
callbacks! That's the natural place to inject the authentication information, but since those functions are synchronous that doesn't work right now.