Hello! Have You checked the response headers instead of the angular code (google chrome dev tools -> network tab)?
You should force a status 401 from the service when the token has expired (in my case, I throw an exception, catch it at a higher level - Global.asax, for example - and return 401 status). I use this Google Chrome extension <https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo?hl=en-US&utm_source=ARC> to test API calls/responses. El miércoles, 13 de enero de 2016, 5:42:39 (UTC-3), Patrick Plaatje escribió: > > Hi, > > I am trying to intercept some of the HTTP calls my app is making to a > remote service. To be able to use this service, I will need to send a JWT > in the header. Sometimes, the token/secret used for the JWT has expired > however and it will be up to my app to intercept the response, and if the > status code is a 4xx, request a new token. > > The interceptor I'm using does actually catch the response error, but when > I log the response object, the response.status contains -1, instead of my > expected 401. Any thoughts? Let me know if you need more info, or a code > snippet. > > Thanks, > Patrick > -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
