-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue using ng-file-upload and http-auth-interceptor #1010
Comments
First |
Thanks! I'll fix the |
Hi guys! When we use angular http interceptor we can "intercept" 401 status and save http-config of the last request
But if we want to retry to send THIS http-request again
unfortunately get the error message about 'addEventListener' of undefined As you can see there are no any overwriting the XMLHttpRequest |
I have looked at the source code and IMHO there are some issues with
and
|
Hi again! Please have a look at it |
Fixed at version 8.0.4 |
http-auth-interceptor (https://github.com/witoldsz/angular-http-auth/blob/master/src/http-auth-interceptor.js) is a very small and popular way of intercepting API 401 messages, asking for authentication, and if ok, retries a queued up $http request.
When ng-file-upload triggers the 401, it breaks..
I think angular-http-auth tries to resend the waiting $http, but the object itself is not how it should, or it have been changed somehow..
The error I am getting is:
Where vendor.js:85820 is https://github.com/danialfarid/ng-file-upload/blob/7.2.1/src/upload.js#L40
I have tried with Upload.upload, and Upload.http, a stripped down version of my Upload look like this;
The xhr object at upload.js#L40 looks like this when it doesnt work;
and like this when it works (ie, when I'm authenticated and not getting a 401 that http-auth-interceptor tries to queue up)..
Any obvious thing I'm doing wrong? Or does this looks like a bug in ng-file-upload or http-auth-interceptor?
versions:
The text was updated successfully, but these errors were encountered: