From c71b9703f3a7ca6f791e5f813c418c8ed23855b7 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Tue, 29 May 2018 14:36:20 -0400 Subject: [PATCH] credentials: 'include' --- src/services/api.service.ts | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/services/api.service.ts b/src/services/api.service.ts index 7eaf415f8a..5d17a6c28c 100644 --- a/src/services/api.service.ts +++ b/src/services/api.service.ts @@ -76,7 +76,7 @@ export class ApiService implements ApiServiceAbstraction { async postIdentityToken(request: TokenRequest): Promise { const response = await fetch(new Request(this.identityBaseUrl + '/connect/token', { body: this.qsStringify(request.toIdentityToken(this.platformUtilsService.identityClientId)), - credentials: 'include', + credentials: 'include', cache: 'no-cache', headers: new Headers({ 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8', @@ -119,7 +119,7 @@ export class ApiService implements ApiServiceAbstraction { const response = await fetch(new Request(this.baseUrl + '/two-factor/send-email-login', { body: JSON.stringify(request), cache: 'no-cache', - credentials: 'include', + credentials: 'include', headers: new Headers({ 'Content-Type': 'application/json; charset=utf-8', 'Device-Type': this.deviceType, @@ -139,6 +139,7 @@ export class ApiService implements ApiServiceAbstraction { const authHeader = await this.handleTokenState(); const response = await fetch(new Request(this.baseUrl + '/accounts/profile', { cache: 'no-cache', + credentials: 'include', headers: new Headers({ 'Accept': 'application/json', 'Authorization': authHeader, @@ -159,7 +160,7 @@ export class ApiService implements ApiServiceAbstraction { const authHeader = await this.handleTokenState(); const response = await fetch(new Request(this.baseUrl + '/accounts/revision-date', { cache: 'no-cache', - credentials: 'include', + credentials: 'include', headers: new Headers({ 'Accept': 'application/json', 'Authorization': authHeader, @@ -179,7 +180,7 @@ export class ApiService implements ApiServiceAbstraction { const response = await fetch(new Request(this.baseUrl + '/accounts/password-hint', { body: JSON.stringify(request), cache: 'no-cache', - credentials: 'include', + credentials: 'include', headers: new Headers({ 'Content-Type': 'application/json; charset=utf-8', 'Device-Type': this.deviceType, @@ -197,7 +198,7 @@ export class ApiService implements ApiServiceAbstraction { const response = await fetch(new Request(this.baseUrl + '/accounts/register', { body: JSON.stringify(request), cache: 'no-cache', - credentials: 'include', + credentials: 'include', headers: new Headers({ 'Content-Type': 'application/json; charset=utf-8', 'Device-Type': this.deviceType, @@ -218,7 +219,7 @@ export class ApiService implements ApiServiceAbstraction { const response = await fetch(new Request(this.baseUrl + '/folders', { body: JSON.stringify(request), cache: 'no-cache', - credentials: 'include', + credentials: 'include', headers: new Headers({ 'Accept': 'application/json', 'Authorization': authHeader, @@ -242,7 +243,7 @@ export class ApiService implements ApiServiceAbstraction { const response = await fetch(new Request(this.baseUrl + '/folders/' + id, { body: JSON.stringify(request), cache: 'no-cache', - credentials: 'include', + credentials: 'include', headers: new Headers({ 'Accept': 'application/json', 'Authorization': authHeader, @@ -265,7 +266,7 @@ export class ApiService implements ApiServiceAbstraction { const authHeader = await this.handleTokenState(); const response = await fetch(new Request(this.baseUrl + '/folders/' + id, { cache: 'no-cache', - credentials: 'include', + credentials: 'include', headers: new Headers({ 'Authorization': authHeader, 'Device-Type': this.deviceType, @@ -286,7 +287,7 @@ export class ApiService implements ApiServiceAbstraction { const response = await fetch(new Request(this.baseUrl + '/ciphers', { body: JSON.stringify(request), cache: 'no-cache', - credentials: 'include', + credentials: 'include', headers: new Headers({ 'Accept': 'application/json', 'Authorization': authHeader, @@ -310,7 +311,7 @@ export class ApiService implements ApiServiceAbstraction { const response = await fetch(new Request(this.baseUrl + '/ciphers/' + id, { body: JSON.stringify(request), cache: 'no-cache', - credentials: 'include', + credentials: 'include', headers: new Headers({ 'Accept': 'application/json', 'Authorization': authHeader, @@ -333,7 +334,7 @@ export class ApiService implements ApiServiceAbstraction { const authHeader = await this.handleTokenState(); const response = await fetch(new Request(this.baseUrl + '/ciphers/' + id, { cache: 'no-cache', - credentials: 'include', + credentials: 'include', headers: new Headers({ 'Authorization': authHeader, 'Device-Type': this.deviceType, @@ -354,7 +355,7 @@ export class ApiService implements ApiServiceAbstraction { const response = await fetch(new Request(this.baseUrl + '/ciphers/' + id + '/attachment', { body: data, cache: 'no-cache', - credentials: 'include', + credentials: 'include', headers: new Headers({ 'Accept': 'application/json', 'Authorization': authHeader, @@ -376,7 +377,7 @@ export class ApiService implements ApiServiceAbstraction { const authHeader = await this.handleTokenState(); const response = await fetch(new Request(this.baseUrl + '/ciphers/' + id + '/attachment/' + attachmentId, { cache: 'no-cache', - credentials: 'include', + credentials: 'include', headers: new Headers({ 'Authorization': authHeader, 'Device-Type': this.deviceType, @@ -396,7 +397,7 @@ export class ApiService implements ApiServiceAbstraction { const authHeader = await this.handleTokenState(); const response = await fetch(new Request(this.baseUrl + '/sync', { cache: 'no-cache', - credentials: 'include', + credentials: 'include', headers: new Headers({ 'Accept': 'application/json', 'Authorization': authHeader, @@ -418,6 +419,7 @@ export class ApiService implements ApiServiceAbstraction { const response = await fetch(new Request(this.baseUrl + '/organizations/' + organizationId + '/import', { body: JSON.stringify(request), cache: 'no-cache', + credentials: 'include', headers: new Headers({ 'Accept': 'application/json', 'Authorization': authHeader, @@ -474,7 +476,7 @@ export class ApiService implements ApiServiceAbstraction { refresh_token: refreshToken, }), cache: 'no-cache', - credentials: 'include', + credentials: 'include', headers: new Headers({ 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8', 'Accept': 'application/json',