httpInterceptors doesn't work ;)
DvirH opened this issue · 0 comments
DvirH commented
Hi Dan!
I just tried to use the interceptor but I noticed that nothing happens when I got 401 unauthorized, So I checked the code in refer to the documentation and I found that you return a promise instead of an object of 'request','response' as explained in here.
For example:
$httpProvider.interceptors.push(function($q, dependency1, dependency2) {
return {
'request': function(config) {
// same as above
},
'response': function(response) {
// same as above
}
};
});