I am building an angular app and we are making a get http request with the http module. The response is 302, and is being automatically redirected to a different url. Our problem is that we need to catch this 302 and stop this second request from happening. Is it possible to do this somehow with an angular4 app? We have been struggling with this for sometime and have checked many resources but are just not sure how to handle this, any help on the issue would be very helpful thanks!
I have added some code that I am using and the response.
logIn(){
this.secure.startSecureLogin()
.then((data)=> console.log(data));
}
startSecureLogin(){
return this.http
.get(this.url)
.toPromise()
.then( (res:Response)=> res.json() );
}