From 4a61fc3274eb31e637321bae6e1b8b67eec207ec Mon Sep 17 00:00:00 2001
From: FORESTIER Fabien <fabien.forestier@soprasteria.com>
Date: Thu, 6 Jun 2019 11:15:30 +0200
Subject: [PATCH] Add wtihCredential option to http requests that needs to send
 creadentials

---
 src/app/services/organization.service.ts | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/app/services/organization.service.ts b/src/app/services/organization.service.ts
index d5a82d7..689c740 100644
--- a/src/app/services/organization.service.ts
+++ b/src/app/services/organization.service.ts
@@ -50,7 +50,7 @@ export class OrganizationService {
   }
 
   delete(id) {
-    return this._httpClient.delete(APP_CONFIG.organizations.url + id);
+    return this._httpClient.delete(APP_CONFIG.organizations.url + id, { withCredentials: true });
   }
 
   uploadLogoAndSaveOrganization(logoFile, organization) {
@@ -66,7 +66,7 @@ export class OrganizationService {
     const formData = new FormData();
     formData.append('file', logoFile);
 
-    return this._httpClient.post<string>(`${APP_CONFIG.mediaLibrary.url}media`, formData).pipe(
+    return this._httpClient.post<string>(`${APP_CONFIG.mediaLibrary.url}media`, formData, { withCredentials: true }).pipe(
       map((response) => {
         return response;
       }),
@@ -75,14 +75,14 @@ export class OrganizationService {
 
   replaceOrCreate(data: Organization): Observable<Organization> {
     if (data.id) {
-      return this._httpClient.put<IOrganization>(APP_CONFIG.organizations.url + data.id, data).pipe(
+      return this._httpClient.put<IOrganization>(APP_CONFIG.organizations.url + data.id, data, { withCredentials: true }).pipe(
         map((response) => {
           return new Organization(response);
         }),
       );
     }
 
-    return this._httpClient.post<IOrganization>(APP_CONFIG.organizations.url, data).pipe(
+    return this._httpClient.post<IOrganization>(APP_CONFIG.organizations.url, data, { withCredentials: true }).pipe(
       map((response) => {
         return new Organization(response);
       }),
-- 
GitLab