I use spring security, which redirects unauthenticated users to a login page.
So when an unauthenticated angular client sends a GET request to an endpoint (expecting JSON), it receives the HTML content of the login page, and the JSON parser fails (Angular2 watch for 302 redirect when fetching resource)
const httpObservable = this.http.get(urlThatWillRedirect).subscribe(data => ...) // JSON parser will fail
How can I handle redirects in Angular?