//JQuery falovered , adds the Authorization headers to each Ajax request - I store them in local storage
$.ajaxPrefilter(function( options ) {
if (options.beforeSend) {
options.beforeSend = function (xhr) {
xhr.setRequestHeader('Authorization', 'Bearer '+localStorage.getItem('token'));
}
}
});