This will allow users to use XHR and HttpClient as well and won't require them to add the axios interceptors manually each time.
Remaining TODOs for this PR
[x] Fix extra debug logging (since we are creating an instance of the modified version and calling that as well
[x] Testing with HttpClient
[x] Testing with XHR
[x] Check if we can just assign to actual.onerror, actual.onload,actual.onreadystatechangeandactual.onloadend` without checking about if those features are available.
[x] Check default value of withCredentials
[x] Migration method - if this method is buggy, how can users disable this entirely and fallback on older axios interception?
[x] Test with vue's axios library
[ ] Test in all browsers + phone browsers
[x] How to properly handle errors in try / catch of handleResponse function?
[ ] Add limit on number of retries for unauthorised response sending (maybe not needed since others dont have this either)
[ ] All example apps work -> especially the ones that monkey patch axios / fetch on the frontend
[x] Test 2+ level of recursion with refreshing
[x] Test error conditions:
[x] > 400 error messages are correctly propagated.
[x] Network errors are properly propagated
[x] Errors during refresh are properly propagated.
[x] Check what happens when axios interceptor is added as well and what we can do about those situations.
[x] Cleanup code
[x] What about react native?
[x] Session claims related changes (handling 403 response code)
[x] setRequestHeader should append or overwrite duplicate keys?
[x] In axios2 tests, we commented out the part were we check the URL from the error -> can we / should we fix this?
This will allow users to use XHR and HttpClient as well and won't require them to add the axios interceptors manually each time.
Remaining TODOs for this PR
actual.onerror
, actual.onload,
actual.onreadystatechangeand
actual.onloadend` without checking about if those features are available.withCredentials
handleResponse
function?