text: 'use strict';
  
  angular.module('core').factory('authInterceptor', ['$q', '$injector',
    function ($q, $injector) {
      return {
        responseError: function(rejection) {
          if (!rejection.config.ignoreAuthModule) {
            switch (rejection.status) {
              case 403:
                $injector.get('$state').transitionTo('forbidden');
                break;
            }
          }
          // otherwise, default behaviour
          return $q.reject(rejection);
        }
      };
    }
  ]);
  