Skip to content

Commit 2c46a95

Browse files
committed
Error when config doesn't exist, issue #118
1 parent e59e420 commit 2c46a95

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Diff for: src/http-auth-interceptor.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* retry of all deferred requests.
1818
* @param data an optional argument to pass on to $broadcast which may be useful for
1919
* example if you need to pass through details of the user that was logged in
20-
* @param configUpdater an optional transformation function that can modify the
20+
* @param configUpdater an optional transformation function that can modify the
2121
* requests that are retried after having logged in. This can be used for example
2222
* to add an authentication token. It must return the request.
2323
*/
@@ -51,11 +51,12 @@
5151
$httpProvider.interceptors.push(['$rootScope', '$q', 'httpBuffer', function($rootScope, $q, httpBuffer) {
5252
return {
5353
responseError: function(rejection) {
54-
if (!rejection.config.ignoreAuthModule) {
54+
var config = rejection.config || {};
55+
if (!config.ignoreAuthModule) {
5556
switch (rejection.status) {
5657
case 401:
5758
var deferred = $q.defer();
58-
httpBuffer.append(rejection.config, deferred);
59+
httpBuffer.append(config, deferred);
5960
$rootScope.$broadcast('event:auth-loginRequired', rejection);
6061
return deferred.promise;
6162
case 403:

0 commit comments

Comments
 (0)