-
-
Save Nilanth/52077ebaf55edbd165fe77ae55146375 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
axios.interceptors.response.use(function (response) { | |
//Dispatch any action on success | |
return response; | |
}, function (error) { | |
if(error.response.status === 401) { | |
//Add Logic to | |
//1. Redirect to login page or | |
//2. Request refresh token | |
} | |
return Promise.reject(error); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment