Add condiction if withCredentials in order to add cookie in the request.
This commit is contained in:
parent
789a0225fa
commit
e0c45b1065
|
@ -36,7 +36,9 @@ export class HttpInterceptorService implements HttpInterceptor {
|
||||||
} else {
|
} else {
|
||||||
if (isPlatformServer(this.platformId)) {
|
if (isPlatformServer(this.platformId)) {
|
||||||
let headers = new HttpHeaders();
|
let headers = new HttpHeaders();
|
||||||
headers = headers.set('Cookie', this.req.get('Cookie'));
|
if(request.withCredentials) {
|
||||||
|
headers = headers.set('Cookie', this.req.get('Cookie'));
|
||||||
|
}
|
||||||
const authReq = request.clone({
|
const authReq = request.clone({
|
||||||
headers: headers
|
headers: headers
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue