@shopsbuilder/auth-sdk 1.2.11 → 1.2.12
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 +5 -5
- package/dist/SaleorAuthClient.mjs +1 -1
- package/dist/{chunk-CKQ223DC.mjs → chunk-E4ERLV5W.mjs} +5 -5
- package/dist/index.js +5 -5
- 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
|
@@ -323,7 +323,7 @@ var SaleorAuthClient = class {
|
|
|
323
323
|
if (!token) {
|
|
324
324
|
return fetch(input, init);
|
|
325
325
|
}
|
|
326
|
-
const headers = init?.headers
|
|
326
|
+
const headers = new Headers(init?.headers);
|
|
327
327
|
const getURL = (input2) => {
|
|
328
328
|
if (typeof input2 === "string") {
|
|
329
329
|
return input2;
|
|
@@ -348,10 +348,10 @@ var SaleorAuthClient = class {
|
|
|
348
348
|
);
|
|
349
349
|
}
|
|
350
350
|
}
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
});
|
|
351
|
+
if (shouldAddAuthorizationHeader) {
|
|
352
|
+
headers.set("Authorization", `Bearer ${token}`);
|
|
353
|
+
}
|
|
354
|
+
return fetch(input, { ...init, headers });
|
|
355
355
|
};
|
|
356
356
|
handleRequestWithTokenRefresh = async (input, requestInit, additionalParams) => {
|
|
357
357
|
const refreshToken = this.refreshTokenStorage?.getRefreshToken();
|
|
@@ -76,7 +76,7 @@ var SaleorAuthClient = class {
|
|
|
76
76
|
if (!token) {
|
|
77
77
|
return fetch(input, init);
|
|
78
78
|
}
|
|
79
|
-
const headers = init?.headers
|
|
79
|
+
const headers = new Headers(init?.headers);
|
|
80
80
|
const getURL = (input2) => {
|
|
81
81
|
if (typeof input2 === "string") {
|
|
82
82
|
return input2;
|
|
@@ -101,10 +101,10 @@ var SaleorAuthClient = class {
|
|
|
101
101
|
);
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
});
|
|
104
|
+
if (shouldAddAuthorizationHeader) {
|
|
105
|
+
headers.set("Authorization", `Bearer ${token}`);
|
|
106
|
+
}
|
|
107
|
+
return fetch(input, { ...init, headers });
|
|
108
108
|
};
|
|
109
109
|
handleRequestWithTokenRefresh = async (input, requestInit, additionalParams) => {
|
|
110
110
|
const refreshToken = this.refreshTokenStorage?.getRefreshToken();
|
package/dist/index.js
CHANGED
|
@@ -326,7 +326,7 @@ var SaleorAuthClient = class {
|
|
|
326
326
|
if (!token) {
|
|
327
327
|
return fetch(input, init);
|
|
328
328
|
}
|
|
329
|
-
const headers = init?.headers
|
|
329
|
+
const headers = new Headers(init?.headers);
|
|
330
330
|
const getURL = (input2) => {
|
|
331
331
|
if (typeof input2 === "string") {
|
|
332
332
|
return input2;
|
|
@@ -351,10 +351,10 @@ var SaleorAuthClient = class {
|
|
|
351
351
|
);
|
|
352
352
|
}
|
|
353
353
|
}
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
});
|
|
354
|
+
if (shouldAddAuthorizationHeader) {
|
|
355
|
+
headers.set("Authorization", `Bearer ${token}`);
|
|
356
|
+
}
|
|
357
|
+
return fetch(input, { ...init, headers });
|
|
358
358
|
};
|
|
359
359
|
handleRequestWithTokenRefresh = async (input, requestInit, additionalParams) => {
|
|
360
360
|
const refreshToken = this.refreshTokenStorage?.getRefreshToken();
|
package/dist/index.mjs
CHANGED
package/dist/react/context.mjs
CHANGED
package/dist/react/index.mjs
CHANGED