@usecapsule/user-management-client
Advanced tools
Comparing version 0.11.0-test-4 to 0.11.0-test-5
@@ -140,8 +140,7 @@ import axios, { AxiosInstance, AxiosRequestHeaders, AxiosResponseHeaders } from 'axios'; | ||
const headers = apiKey ? { "X-External-API-Key": apiKey } : undefined | ||
this.baseRequest = axios.create({ | ||
const axiosConfig = { | ||
baseURL: userManagementHost, | ||
withCredentials: true, | ||
headers, | ||
}); | ||
} as AxiosRequestConfig; | ||
@@ -153,3 +152,3 @@ if (retrieveSessionCookie) { | ||
axios.defaults.transformRequest = [ | ||
axiosConfig.transformRequest = [ | ||
function (data: any, headers?: AxiosRequestHeaders): any { | ||
@@ -180,3 +179,3 @@ console.log('request headers\n', headers) | ||
axios.defaults.transformResponse = [ | ||
axiosConfig.transformResponse = [ | ||
...defaultTransformResponse, | ||
@@ -198,2 +197,4 @@ function (data: any, headers?: AxiosResponseHeaders): any { | ||
this.baseRequest = axios.create(axiosConfig); | ||
if (opts?.useFetchAdapter) { | ||
@@ -200,0 +201,0 @@ axios.defaults.adapter = function(config: AxiosRequestConfig) { |
@@ -379,7 +379,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
var headers = apiKey ? { "X-External-API-Key": apiKey } : undefined; | ||
this.baseRequest = axios.create({ | ||
var axiosConfig = { | ||
baseURL: userManagementHost, | ||
withCredentials: true, | ||
headers: headers, | ||
}); | ||
}; | ||
if (retrieveSessionCookie) { | ||
@@ -389,3 +389,3 @@ var defaultTransformRequest = Array.isArray(axios.defaults.transformRequest) ? | ||
[axios.defaults.transformRequest]; | ||
axios.defaults.transformRequest = __spreadArray([ | ||
axiosConfig.transformRequest = __spreadArray([ | ||
function (data, headers) { | ||
@@ -411,3 +411,3 @@ console.log('request headers\n', headers); | ||
[axios.defaults.transformResponse]; | ||
axios.defaults.transformResponse = __spreadArray(__spreadArray([], defaultTransformResponse, true), [ | ||
axiosConfig.transformResponse = __spreadArray(__spreadArray([], defaultTransformResponse, true), [ | ||
function (data, headers) { | ||
@@ -426,2 +426,3 @@ var _a; | ||
} | ||
this.baseRequest = axios.create(axiosConfig); | ||
if (opts === null || opts === void 0 ? void 0 : opts.useFetchAdapter) { | ||
@@ -428,0 +429,0 @@ axios.defaults.adapter = function (config) { |
{ | ||
"name": "@usecapsule/user-management-client", | ||
"version": "0.11.0-test-4", | ||
"version": "0.11.0-test-5", | ||
"main": "dist/client.js", | ||
@@ -5,0 +5,0 @@ "types": "dist/client.d.ts", |
Sorry, the diff of this file is not supported yet
70538
1371