I\'ve created a middleware that checks if a request returns an invalid access response. If the status is a 401, I want to redirect the user to the login page
Here\'s the
use onEnter method of react-router. call a function which will check for the access. Example:
onEnter
function checkAccess() { //some logic to check if(notAuthorized){ window.location.href= "/login"; } }