@shopsbuilder/auth-sdk 1.2.10 → 1.2.11
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.d.mts +1 -0
- package/dist/SaleorAuthClient.d.ts +1 -0
- package/dist/SaleorAuthClient.js +5 -2
- package/dist/SaleorAuthClient.mjs +1 -1
- package/dist/{chunk-3UGMWVQN.mjs → chunk-CKQ223DC.mjs} +5 -2
- package/dist/index.js +5 -2
- 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
|
@@ -272,6 +272,7 @@ var SaleorAuthClient = class {
|
|
|
272
272
|
tokenRefreshPromise = null;
|
|
273
273
|
onAuthRefresh;
|
|
274
274
|
saleorApiUrl;
|
|
275
|
+
storageKeyPrefix;
|
|
275
276
|
/**
|
|
276
277
|
* Persistent storage (for refresh token)
|
|
277
278
|
*/
|
|
@@ -307,7 +308,8 @@ var SaleorAuthClient = class {
|
|
|
307
308
|
}
|
|
308
309
|
this.onAuthRefresh = onAuthRefresh;
|
|
309
310
|
this.saleorApiUrl = saleorApiUrl;
|
|
310
|
-
|
|
311
|
+
this.storageKeyPrefix = storageKeyPrefix ?? saleorApiUrl;
|
|
312
|
+
const keyPrefix = this.storageKeyPrefix;
|
|
311
313
|
const refreshTokenRepo = refreshTokenStorage ?? (typeof window !== "undefined" ? window.localStorage : void 0);
|
|
312
314
|
this.refreshTokenStorage = refreshTokenRepo ? new SaleorRefreshTokenStorageHandler(refreshTokenRepo, keyPrefix) : null;
|
|
313
315
|
const accessTokenRepo = accessTokenStorage ?? getInMemoryAccessTokenStorage();
|
|
@@ -332,7 +334,8 @@ var SaleorAuthClient = class {
|
|
|
332
334
|
}
|
|
333
335
|
};
|
|
334
336
|
const iss = getTokenIss(token);
|
|
335
|
-
const
|
|
337
|
+
const requestUrl = getURL(input);
|
|
338
|
+
const issuerAndDomainMatch = requestUrl === iss || this.storageKeyPrefix === iss;
|
|
336
339
|
const shouldAddAuthorizationHeader = issuerAndDomainMatch || additionalParams?.allowPassingTokenToThirdPartyDomains;
|
|
337
340
|
if (!issuerAndDomainMatch) {
|
|
338
341
|
if (shouldAddAuthorizationHeader) {
|
|
@@ -25,6 +25,7 @@ var SaleorAuthClient = class {
|
|
|
25
25
|
tokenRefreshPromise = null;
|
|
26
26
|
onAuthRefresh;
|
|
27
27
|
saleorApiUrl;
|
|
28
|
+
storageKeyPrefix;
|
|
28
29
|
/**
|
|
29
30
|
* Persistent storage (for refresh token)
|
|
30
31
|
*/
|
|
@@ -60,7 +61,8 @@ var SaleorAuthClient = class {
|
|
|
60
61
|
}
|
|
61
62
|
this.onAuthRefresh = onAuthRefresh;
|
|
62
63
|
this.saleorApiUrl = saleorApiUrl;
|
|
63
|
-
|
|
64
|
+
this.storageKeyPrefix = storageKeyPrefix ?? saleorApiUrl;
|
|
65
|
+
const keyPrefix = this.storageKeyPrefix;
|
|
64
66
|
const refreshTokenRepo = refreshTokenStorage ?? (typeof window !== "undefined" ? window.localStorage : void 0);
|
|
65
67
|
this.refreshTokenStorage = refreshTokenRepo ? new SaleorRefreshTokenStorageHandler(refreshTokenRepo, keyPrefix) : null;
|
|
66
68
|
const accessTokenRepo = accessTokenStorage ?? getInMemoryAccessTokenStorage();
|
|
@@ -85,7 +87,8 @@ var SaleorAuthClient = class {
|
|
|
85
87
|
}
|
|
86
88
|
};
|
|
87
89
|
const iss = getTokenIss(token);
|
|
88
|
-
const
|
|
90
|
+
const requestUrl = getURL(input);
|
|
91
|
+
const issuerAndDomainMatch = requestUrl === iss || this.storageKeyPrefix === iss;
|
|
89
92
|
const shouldAddAuthorizationHeader = issuerAndDomainMatch || additionalParams?.allowPassingTokenToThirdPartyDomains;
|
|
90
93
|
if (!issuerAndDomainMatch) {
|
|
91
94
|
if (shouldAddAuthorizationHeader) {
|
package/dist/index.js
CHANGED
|
@@ -275,6 +275,7 @@ var SaleorAuthClient = class {
|
|
|
275
275
|
tokenRefreshPromise = null;
|
|
276
276
|
onAuthRefresh;
|
|
277
277
|
saleorApiUrl;
|
|
278
|
+
storageKeyPrefix;
|
|
278
279
|
/**
|
|
279
280
|
* Persistent storage (for refresh token)
|
|
280
281
|
*/
|
|
@@ -310,7 +311,8 @@ var SaleorAuthClient = class {
|
|
|
310
311
|
}
|
|
311
312
|
this.onAuthRefresh = onAuthRefresh;
|
|
312
313
|
this.saleorApiUrl = saleorApiUrl;
|
|
313
|
-
|
|
314
|
+
this.storageKeyPrefix = storageKeyPrefix ?? saleorApiUrl;
|
|
315
|
+
const keyPrefix = this.storageKeyPrefix;
|
|
314
316
|
const refreshTokenRepo = refreshTokenStorage ?? (typeof window !== "undefined" ? window.localStorage : void 0);
|
|
315
317
|
this.refreshTokenStorage = refreshTokenRepo ? new SaleorRefreshTokenStorageHandler(refreshTokenRepo, keyPrefix) : null;
|
|
316
318
|
const accessTokenRepo = accessTokenStorage ?? getInMemoryAccessTokenStorage();
|
|
@@ -335,7 +337,8 @@ var SaleorAuthClient = class {
|
|
|
335
337
|
}
|
|
336
338
|
};
|
|
337
339
|
const iss = getTokenIss(token);
|
|
338
|
-
const
|
|
340
|
+
const requestUrl = getURL(input);
|
|
341
|
+
const issuerAndDomainMatch = requestUrl === iss || this.storageKeyPrefix === iss;
|
|
339
342
|
const shouldAddAuthorizationHeader = issuerAndDomainMatch || additionalParams?.allowPassingTokenToThirdPartyDomains;
|
|
340
343
|
if (!issuerAndDomainMatch) {
|
|
341
344
|
if (shouldAddAuthorizationHeader) {
|
package/dist/index.mjs
CHANGED
package/dist/react/context.mjs
CHANGED
package/dist/react/index.mjs
CHANGED