I want to make a redirection in axios interceptors when receiving a 403 error. But how can I access the history outside React components ?
In Navigating Programatically
This seems to work for me
function (error) { var accessDenied = error.toString().indexOf("401"); if (accessDenied !== -1) { console.log('ACCESS DENIED') return window.location.href = '/accessdenied' } });