|
43 | 43 | * and broadcasts 'event:angular-auth-loginRequired'.
|
44 | 44 | */
|
45 | 45 | .config(['$httpProvider', function($httpProvider) {
|
46 |
| - $httpProvider.interceptors.push(['$rootScope', '$q', 'httpBuffer', function($rootScope, $q, httpBuffer) { |
47 |
| - return { |
48 |
| - 'responseError': function(rejection) { |
49 |
| - if (rejection.status === 401 && !rejection.config.ignoreAuthModule) { |
50 |
| - var deferred = $q.defer(); |
51 |
| - httpBuffer.append(rejection.config, deferred); |
52 |
| - $rootScope.$broadcast('event:auth-loginRequired', rejection); |
53 |
| - return deferred.promise; |
54 |
| - } |
55 |
| - // otherwise, default behaviour |
56 |
| - return $q.reject(rejection); |
57 |
| - } |
| 46 | + $httpProvider.interceptors.push(['$rootScope', '$q', 'httpBuffer', function($rootScope, $q, httpBuffer) { |
| 47 | + return { |
| 48 | + responseError: function(rejection) { |
| 49 | + if (rejection.status === 401 && !rejection.config.ignoreAuthModule) { |
| 50 | + var deferred = $q.defer(); |
| 51 | + httpBuffer.append(rejection.config, deferred); |
| 52 | + $rootScope.$broadcast('event:auth-loginRequired', rejection); |
| 53 | + return deferred.promise; |
58 | 54 | }
|
59 |
| - }]); |
| 55 | + // otherwise, default behaviour |
| 56 | + return $q.reject(rejection); |
| 57 | + } |
| 58 | + }; |
| 59 | + }]); |
60 | 60 | }]);
|
61 | 61 |
|
62 | 62 | /**
|
|
0 commit comments