Hi Michael,
The response object in AngularJS looks like this:
> Object {data: "", status: 0, headers: function, config: Object}
>
> What I would expect is status code 302 and even the redirect location, so
> that I could handle the redirect to the login-page in Angular myself...
>
Well, I was assuming you got redirected by the browser. This is way easier
to manage! You gave already the solution too!
On Wednesday, January 29, 2014 3:28:50 PM UTC+1, Michael Hunziker wrote:
>
> What I could do is implement an httpInterceptor which will handle response
> errors with status code 0. As soon as I get such a response I could trigger
> a $window.location.reload. This would again trigger the proxy and he would
> redirect us to the login page.
>
Be warned that in the new versions 1.2.9+ you will get an 404 instead of a
0, and yo should also check for the string 'not allowed access' inside your
status. Just to make sure you don't direct to the login page on anything
then the login failure.
Regards
Sander
--
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 http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.