github.com/apremalal/vamps-core@v1.0.1-0.20161221121535-d430b56ec174/server/webapps/app/base/js/base.js (about) 1 $(document).ajaxError(function (event, jqxhr, settings, thrownError) { 2 if (thrownError == 'Unauthorized') { 3 window.location.href = loginPageUrl 4 } 5 }); 6 7 $(document).ajaxSend(function (event, request, settings) { 8 request.setRequestHeader("Authorization", "Bearer " + Cookies.get("jwt")); 9 }); 10 11 if (!Cookies.get("jwt")) { 12 window.location.href = loginPageUrl; 13 }