DEV Community

How can I re-call API in case of axios intercepter error

christian0125 on July 16, 2022

How can I re-call API in case of axios intercepter error ...
Collapse
 
ecyrbe profile image
ecyrbe • Edited

Yes you can. But to evoid Infinite loop, or sending Bad credentials when renewing, do not call your axios instance that you named service (who then will again call your interceptors).

But instead call axios default instance or a fresh one and be sure you did not plug an interceptor to it.

Take a look here from my zodios lib