btford/ngmin

Support inline function passing to $httpProvider.interceptors.push

fitzchak opened this issue · 3 comments

.config(function($httpProvider) {
    $httpProvider.interceptors.push(function($rootScope, $q, httpBuffer) {
      return {
        responseError: function(rejection) {
          if (rejection.status === 401 && !rejection.config.ignoreAuthModule) {
            var deferred = $q.defer();
            httpBuffer.append(rejection.config, deferred);
            $rootScope.$broadcast('event:auth-loginRequired', rejection);
            return deferred.promise;
          }
          // otherwise, default behavior
          return $q.reject(rejection);
        }
      };
    });
  });

Duplicate of #59 ?!

Yes...

@fitzchak please check existing issues before creating new ones. Thanks!