diff --git a/src/services/api.service.ts b/src/services/api.service.ts index 97eed0326f..7eaf415f8a 100644 --- a/src/services/api.service.ts +++ b/src/services/api.service.ts @@ -76,6 +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', cache: 'no-cache', headers: new Headers({ 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8', @@ -118,6 +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', headers: new Headers({ 'Content-Type': 'application/json; charset=utf-8', 'Device-Type': this.deviceType, @@ -157,6 +159,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', headers: new Headers({ 'Accept': 'application/json', 'Authorization': authHeader, @@ -176,6 +179,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', headers: new Headers({ 'Content-Type': 'application/json; charset=utf-8', 'Device-Type': this.deviceType, @@ -193,6 +197,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', headers: new Headers({ 'Content-Type': 'application/json; charset=utf-8', 'Device-Type': this.deviceType, @@ -213,6 +218,7 @@ export class ApiService implements ApiServiceAbstraction { const response = await fetch(new Request(this.baseUrl + '/folders', { body: JSON.stringify(request), cache: 'no-cache', + credentials: 'include', headers: new Headers({ 'Accept': 'application/json', 'Authorization': authHeader, @@ -236,6 +242,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', headers: new Headers({ 'Accept': 'application/json', 'Authorization': authHeader, @@ -258,6 +265,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', headers: new Headers({ 'Authorization': authHeader, 'Device-Type': this.deviceType, @@ -278,6 +286,7 @@ export class ApiService implements ApiServiceAbstraction { const response = await fetch(new Request(this.baseUrl + '/ciphers', { body: JSON.stringify(request), cache: 'no-cache', + credentials: 'include', headers: new Headers({ 'Accept': 'application/json', 'Authorization': authHeader, @@ -301,6 +310,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', headers: new Headers({ 'Accept': 'application/json', 'Authorization': authHeader, @@ -323,6 +333,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', headers: new Headers({ 'Authorization': authHeader, 'Device-Type': this.deviceType, @@ -343,6 +354,7 @@ export class ApiService implements ApiServiceAbstraction { const response = await fetch(new Request(this.baseUrl + '/ciphers/' + id + '/attachment', { body: data, cache: 'no-cache', + credentials: 'include', headers: new Headers({ 'Accept': 'application/json', 'Authorization': authHeader, @@ -364,6 +376,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', headers: new Headers({ 'Authorization': authHeader, 'Device-Type': this.deviceType, @@ -383,6 +396,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', headers: new Headers({ 'Accept': 'application/json', 'Authorization': authHeader, @@ -460,6 +474,7 @@ export class ApiService implements ApiServiceAbstraction { refresh_token: refreshToken, }), cache: 'no-cache', + credentials: 'include', headers: new Headers({ 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8', 'Accept': 'application/json',