What i want to do is this:
if im getting 401 response i want to intercept and send another post request to get new token from my server. but i cant do it in the angular interceptor. i get this error:
Circular dependency found: authService <- authIn <- $http <- $translateStaticFilesLoader
whats the problem, and how i can do what i want?
return {
'responseError': function(rejection) {
if (rejection.status === 401) {
authService.getNewToken();
return $q.reject(rejection);
}
return $q.reject(rejection);
}
};
}