Comments (16)
Same bug encountered on Win8 with IE10/CORS.
from angular-http-auth.
Thanks for the info.
Any plans for fixing this on master or is this use-case too rare? The solution above is still working but it could be prettier though.
from angular-http-auth.
@witoldsz, as the maintainer of this module, what is your view on this issue? Thank you.
from angular-http-auth.
I think that fixing or walking over the bugs of the thing called IE is out of the scope of this project.
I am pretty sure someone can provide a fix for broken IE XHR requests for AngularJS (or maybe a lever below AngularJS), maybe as a $http interceptor, so once the response hits this one, the status code will be correct already.
from angular-http-auth.
Are $http
interceptors different than $httpProvider
interceptors?
from angular-http-auth.
@stereokai $http
is a service created (provided) by $httpProvider
. We register "HTTP interceptors" when configuring the $httpProvider
, so $http
service has them once it is created.
from angular-http-auth.
How can you make sure the interceptor responsible for taking care of the IE bug takes place before any other interceptor? Declare (push) it first?
from angular-http-auth.
Well, looking at the API, I guess you have to push it at the beginning of the queue and make sure there are no other modules pushing anything before it. I can't recall any other priority mechanism for http interceptors.
from angular-http-auth.
Sweet, thank you.
from angular-http-auth.
Looks like this has been changed in 1.3, I was having problems because Angular was turning status of 0 into a 404 before the interceptors fired. Thanks!
from angular-http-auth.
Well, with chrome and latest angular (1.3.0-beta.17), angular always return status 0 on OPTIONS request error. Is it possible to fix that ? Thanks
from angular-http-auth.
What am I supposed to do? Fix Angular, Chrome, both?
from angular-http-auth.
maybe you can try :)
But is it possible to test response.status === 0 as on 1st comment ?
from angular-http-auth.
No, that is not possible, I am sorry. But you can do it in your own $http interceptor and insert it at the beginning, so this module will see whatever you tweak over there.
from angular-http-auth.
What am I supposed to do? Fix Angular, Chrome, both?
@witoldsz If there was a bash.org for Github Comments, this comment would be ranked #1.
from angular-http-auth.
Not sure if people found a resolution to this, but I found that status 0 was only returned if the Pre-Flight OPTIONS request returned a non 200 code.
It seems that the Angular $resource module has logic to translate these status codes to a 0.
If I make OPTIONS requests non authorised on the server side then when the subsequent request (GET,POST, etc) is made then the status is correctly returned as 401 formunathorised
Express example:
app.use(jwt({ secret: secret}).unless({ method: 'OPTIONS', path: ['/token']}));
from angular-http-auth.
Related Issues (20)
- Breaks angular-loading-bar HOT 7
- doesn't seem to use the config for the next requests HOT 4
- bower install warning HOT 7
- There is no minified version on bower/npm HOT 5
- Issue using ng-file-upload and http-auth-interceptor HOT 14
- resume loading screen HOT 3
- login address returns 404 after 401 intercept HOT 2
- Error when config doesn't exist HOT 1
- Even Unauthenticated user can see static contents of the page HOT 5
- Add Trip distance
- How angular-http-auth-buffer works ? HOT 2
- npm version stuck on 1.2.1 HOT 2
- Prevent double event HOT 1
- Basic authentication results in 404 HOT 4
- no 'event:auth-loginRequired' since 1.3.0 HOT 6
- Scenario with refresh token (e.g. authService.ignoreCurrentRequest()) HOT 3
- Add Better loginCancelled documentation to avoid confusion HOT 1
- Please add license = "MIT" to bower.son HOT 2
- Even't function won't fire HOT 6
- Interceptor automatically captures all 401s and prevents other interceptors from having an opportunity to examine them
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-http-auth.