witoldsz/angular-http-auth

Error when config doesn't exist

simison opened this issue · 1 comments

Seeing errors because of this line:

if (!rejection.config.ignoreAuthModule) {

Similar to this situation: chieffancypants/angular-loading-bar#50

Basically I'm having this situation:

  • Loading from endpoint and expecting json response.
  • I get 502 (Bad Gateway) and bunch of html as a response
  • Because of <, Angular gives an error:
SyntaxError: Unexpected token <
    at Object.parse (native)
    at fromJson (http://localhost:3000/lib/angular/angular.js?c=1446764845080:1252:14)
    at defaultHttpResponseTransform (http://localhost:3000/lib/angular/angular.js?c=1446764845080:9414:16)
    at http://localhost:3000/lib/angular/angular.js?c=1446764845080:9505:12
    at forEach (http://localhost:3000/lib/angular/angular.js?c=1446764845080:336:20)
    at transformData (http://localhost:3000/lib/angular/angular.js?c=1446764845080:9504:3)
    at transformResponse (http://localhost:3000/lib/angular/angular.js?c=1446764845080:10276:23)
    at processQueue (http://localhost:3000/lib/angular/angular.js?c=1446764845080:14745:28)
    at http://localhost:3000/lib/angular/angular.js?c=1446764845080:14761:27
    at Scope.$eval (http://localhost:3000/lib/angular/angular.js?c=1446764845080:15989:28)

... but passes it onwards and is followed by this error:

TypeError: Cannot read property 'ignoreAuthModule' of undefined
    at responseError (http-auth-interceptor.js?c=1446764845080:60)
    at processQueue (angular.js?c=1446764845080:14745)
    at angular.js?c=1446764845080:14761
    at Scope.$eval (angular.js?c=1446764845080:15989)
    at Scope.$digest (angular.js?c=1446764845080:15800)
    at Scope.$apply (angular.js?c=1446764845080:16097)
    at done (angular.js?c=1446764845080:10546)
    at completeRequest (angular.js?c=1446764845080:10744)
    at XMLHttpRequest.requestLoaded (angular.js?c=1446764845080:10685)

Would #119 fix the problem?