text: app.factory('AuthInterceptor', ['$rootScope', '$q', '$window', '$location', function ($rootScope, $q, $window, $location) {
      return {
          request: function (config) {
              config.headers = config.headers || {};
              if ($window.sessionStorage.token) {
                  config.headers.Authorization = 'Bearer ' + $window.sessionStorage.token;
              }
              return config;
          },
          responseError: function(rejection) {
              return $q.reject(rejection);
          }
      };
  }]);
  