When authentication is rejected, cancelAllAwaitingRequestsOnFailure is executed, which goes through the queue of responses and calls 'cancel' for all of them. Unfortunately cancel rejects a promise with no value provided. Interceptor plays with HTTP responses so it should always provide something compatible with this API. It is very likely to break promises chaining here, as failure callbacks might blindly try to read some basic information from response like data, status, url, headers etc. (in order to provide some feedback to the user).
I would propose to return original unauthorized response in case of canceling.
Hi,
When authentication is rejected, cancelAllAwaitingRequestsOnFailure is executed, which goes through the queue of responses and calls 'cancel' for all of them. Unfortunately cancel rejects a promise with no value provided. Interceptor plays with HTTP responses so it should always provide something compatible with this API. It is very likely to break promises chaining here, as failure callbacks might blindly try to read some basic information from response like data, status, url, headers etc. (in order to provide some feedback to the user).
I would propose to return original unauthorized response in case of canceling.
Cheers, Bartek