app .config(function ($locationProvider, $httpProvider, $ngBootboxConfigProvider) { $locationProvider .html5Mode(true); $httpProvider.interceptors.push(function ($q) { return { 'responseError': function (rejection) { if (rejection.status === 401) { location.replace('/logowanie/'); return $q.defer().promise; } return $q.reject(rejection); } }; }); $ngBootboxConfigProvider.setDefaultLocale('pl'); });