Handling Access and Refresh Tokens using Axios Interceptors. | axios post bearer token
Axiosisapromise-basedHTTPclientwhichiswritteninJavaScripttoperformHTTPcommunications.IthasonepowerfulfeaturecalledInterceptors.Axiosinterceptorsallowyoutorunyourcodeormodifytherequestand/orresponsebeforetherequestand/orresponsereachestheirdestination.IassumethatyouarefamiliarwithAxioslibary[1],Accesstokens[2]andRefreshtokens[3].Axiosinterceptorsallowyoutorunyourcodeormodifytherequestand/orresponsebeforetherequestand/orresponseisstarted.Insimplewords,Itallowsyoutowriteorexecuteapieceofyourcod...
Axios is a promise-based HTTP client which is written in JavaScript to perform HTTP communications. It has one powerful feature called Interceptors. Axios interceptors allow you to run your code or modify the request and/or response before the request and/or response reaches their destination.
I assume that you are familiar with Axios libary[1], Access tokens[2] and Refresh tokens[3].
Axios interceptors allow you to run your code or modify the request and/or response before the request and/or response is started.
In simple words,It allows you to write or execute a piece of your code before the request gets sent.It allows you to write or execute a piece of your code befor...