@shopsbuilder/auth-sdk 1.2.5 → 1.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/SaleorAuthClient.js +10 -1
- package/dist/SaleorAuthClient.mjs +1 -1
- package/dist/{chunk-W2DGQWZK.mjs → chunk-QFUROJ4G.mjs} +10 -1
- package/dist/index.js +10 -1
- package/dist/index.mjs +1 -1
- package/dist/react/SaleorAuthProvider.mjs +1 -1
- package/dist/react/context.mjs +1 -1
- package/dist/react/index.mjs +1 -1
- package/package.json +1 -1
package/dist/SaleorAuthClient.js
CHANGED
|
@@ -356,9 +356,18 @@ var SaleorAuthClient = class {
|
|
|
356
356
|
this.tokenRefreshPromise = null;
|
|
357
357
|
return this.runAuthorizedRequest(input, requestInit, additionalParams);
|
|
358
358
|
}
|
|
359
|
+
const refreshHeaders = {};
|
|
360
|
+
if (requestInit?.headers) {
|
|
361
|
+
const origHeaders = new Headers(requestInit.headers);
|
|
362
|
+
for (const [key, value] of origHeaders.entries()) {
|
|
363
|
+
if (key !== "host" && key !== "content-type") {
|
|
364
|
+
refreshHeaders[key] = value;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
}
|
|
359
368
|
const refreshRequestData = getRequestData(TOKEN_REFRESH, { refreshToken }, {
|
|
360
369
|
...this.defaultRequestInit,
|
|
361
|
-
headers:
|
|
370
|
+
headers: refreshHeaders
|
|
362
371
|
});
|
|
363
372
|
console.log("[auth-sdk] Token refresh request:", JSON.stringify({
|
|
364
373
|
url: this.saleorApiUrl,
|
|
@@ -119,9 +119,18 @@ var SaleorAuthClient = class {
|
|
|
119
119
|
this.tokenRefreshPromise = null;
|
|
120
120
|
return this.runAuthorizedRequest(input, requestInit, additionalParams);
|
|
121
121
|
}
|
|
122
|
+
const refreshHeaders = {};
|
|
123
|
+
if (requestInit?.headers) {
|
|
124
|
+
const origHeaders = new Headers(requestInit.headers);
|
|
125
|
+
for (const [key, value] of origHeaders.entries()) {
|
|
126
|
+
if (key !== "host" && key !== "content-type") {
|
|
127
|
+
refreshHeaders[key] = value;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
122
131
|
const refreshRequestData = getRequestData(TOKEN_REFRESH, { refreshToken }, {
|
|
123
132
|
...this.defaultRequestInit,
|
|
124
|
-
headers:
|
|
133
|
+
headers: refreshHeaders
|
|
125
134
|
});
|
|
126
135
|
console.log("[auth-sdk] Token refresh request:", JSON.stringify({
|
|
127
136
|
url: this.saleorApiUrl,
|
package/dist/index.js
CHANGED
|
@@ -359,9 +359,18 @@ var SaleorAuthClient = class {
|
|
|
359
359
|
this.tokenRefreshPromise = null;
|
|
360
360
|
return this.runAuthorizedRequest(input, requestInit, additionalParams);
|
|
361
361
|
}
|
|
362
|
+
const refreshHeaders = {};
|
|
363
|
+
if (requestInit?.headers) {
|
|
364
|
+
const origHeaders = new Headers(requestInit.headers);
|
|
365
|
+
for (const [key, value] of origHeaders.entries()) {
|
|
366
|
+
if (key !== "host" && key !== "content-type") {
|
|
367
|
+
refreshHeaders[key] = value;
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
}
|
|
362
371
|
const refreshRequestData = getRequestData(TOKEN_REFRESH, { refreshToken }, {
|
|
363
372
|
...this.defaultRequestInit,
|
|
364
|
-
headers:
|
|
373
|
+
headers: refreshHeaders
|
|
365
374
|
});
|
|
366
375
|
console.log("[auth-sdk] Token refresh request:", JSON.stringify({
|
|
367
376
|
url: this.saleorApiUrl,
|
package/dist/index.mjs
CHANGED
package/dist/react/context.mjs
CHANGED
package/dist/react/index.mjs
CHANGED