Support inline function passing to $httpProvider.interceptors.push
fitzchak opened this issue · 3 comments
fitzchak commented
.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);
}
};
});
});
fitzchak commented
Yes...