We were using HttpModule in angular.
Now we moved to HttpClient as we heard it is better to use it.
All is working fine, BUT - when we used HttpModule we had this piece of code to make chrome send the credentials to the server.
constructor(private http:Http){
let _build = (<any>this.http)._backend._browseXHR.build;
(<any>this.http)._backend._browseXHR.build = () => {
let _xhr = _build();
_xhr.withCredentials = true;
return (_xhr);
};
}
We had to write this only one time in the first service, and all our services were using credentials.
Now we are unable to "convert" this code if we are using HttpClient.
We know we can send in each call the withCredentials:true, but we want something like what we had, that one place is enough for all calls.
What is the parallel code to the above if using HttpClient?