I'm trying to make a check where i can redirect the user to a other page if the XHR request returns a 403 error. My current XHR request is set like this
beforeSend: function(xhr){
xhr.setRequestHeader('Authorization', 'Bearer ' + token);
},
This is inside a AJAX call. How could i redirect the user if the XHR returns a 403? Thanks in advance!