'use strict'; angular .module('app.config', []) .service('authInterceptor', function($q, $location, $cookies, $window) { var service = this; service.responseError = function(response) { if (response.status == 401){ console.log("UNAUTHORIZED"); } return $q.reject(response); }; }) .config(['$httpProvider', function($httpProvider) { $httpProvider.interceptors.push('authInterceptor'); }]);