@shopsbuilder/auth-sdk 1.2.1 → 1.2.3

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.
@@ -341,10 +341,11 @@ var SaleorAuthClient = class {
341
341
  this.onAuthRefresh?.(false);
342
342
  if (refreshErrors?.length || graphqlErrors?.length || !token) {
343
343
  console.warn("[auth-sdk] Token refresh failed:", JSON.stringify({
344
- graphqlErrors: graphqlErrors?.length ?? 0,
345
- refreshErrors: refreshErrors?.map((e) => e.message),
344
+ graphqlErrors: graphqlErrors ?? [],
345
+ refreshErrors: refreshErrors ?? [],
346
346
  hasToken: Boolean(token),
347
- httpStatus: response.status
347
+ httpStatus: response.status,
348
+ rawData: res.data ?? null
348
349
  }));
349
350
  this.tokenRefreshPromise = null;
350
351
  this.refreshTokenStorage?.clearAuthStorage();
@@ -357,7 +358,7 @@ var SaleorAuthClient = class {
357
358
  }
358
359
  this.tokenRefreshPromise = fetch(
359
360
  this.saleorApiUrl,
360
- getRequestData(TOKEN_REFRESH, { refreshToken }, { ...this.defaultRequestInit, ...requestInit })
361
+ getRequestData(TOKEN_REFRESH, { refreshToken }, this.defaultRequestInit)
361
362
  );
362
363
  return this.fetchWithAuth(input, requestInit, additionalParams);
363
364
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  SaleorAuthClient,
3
3
  createSaleorAuthClient
4
- } from "./chunk-OGC5TPQ2.mjs";
4
+ } from "./chunk-LTHESKMI.mjs";
5
5
  import "./chunk-BZFBMGPG.mjs";
6
6
  import "./chunk-263DHBMK.mjs";
7
7
  import "./chunk-UDLCOX6B.mjs";
@@ -104,10 +104,11 @@ var SaleorAuthClient = class {
104
104
  this.onAuthRefresh?.(false);
105
105
  if (refreshErrors?.length || graphqlErrors?.length || !token) {
106
106
  console.warn("[auth-sdk] Token refresh failed:", JSON.stringify({
107
- graphqlErrors: graphqlErrors?.length ?? 0,
108
- refreshErrors: refreshErrors?.map((e) => e.message),
107
+ graphqlErrors: graphqlErrors ?? [],
108
+ refreshErrors: refreshErrors ?? [],
109
109
  hasToken: Boolean(token),
110
- httpStatus: response.status
110
+ httpStatus: response.status,
111
+ rawData: res.data ?? null
111
112
  }));
112
113
  this.tokenRefreshPromise = null;
113
114
  this.refreshTokenStorage?.clearAuthStorage();
@@ -120,7 +121,7 @@ var SaleorAuthClient = class {
120
121
  }
121
122
  this.tokenRefreshPromise = fetch(
122
123
  this.saleorApiUrl,
123
- getRequestData(TOKEN_REFRESH, { refreshToken }, { ...this.defaultRequestInit, ...requestInit })
124
+ getRequestData(TOKEN_REFRESH, { refreshToken }, this.defaultRequestInit)
124
125
  );
125
126
  return this.fetchWithAuth(input, requestInit, additionalParams);
126
127
  };
package/dist/index.js CHANGED
@@ -344,10 +344,11 @@ var SaleorAuthClient = class {
344
344
  this.onAuthRefresh?.(false);
345
345
  if (refreshErrors?.length || graphqlErrors?.length || !token) {
346
346
  console.warn("[auth-sdk] Token refresh failed:", JSON.stringify({
347
- graphqlErrors: graphqlErrors?.length ?? 0,
348
- refreshErrors: refreshErrors?.map((e) => e.message),
347
+ graphqlErrors: graphqlErrors ?? [],
348
+ refreshErrors: refreshErrors ?? [],
349
349
  hasToken: Boolean(token),
350
- httpStatus: response.status
350
+ httpStatus: response.status,
351
+ rawData: res.data ?? null
351
352
  }));
352
353
  this.tokenRefreshPromise = null;
353
354
  this.refreshTokenStorage?.clearAuthStorage();
@@ -360,7 +361,7 @@ var SaleorAuthClient = class {
360
361
  }
361
362
  this.tokenRefreshPromise = fetch(
362
363
  this.saleorApiUrl,
363
- getRequestData(TOKEN_REFRESH, { refreshToken }, { ...this.defaultRequestInit, ...requestInit })
364
+ getRequestData(TOKEN_REFRESH, { refreshToken }, this.defaultRequestInit)
364
365
  );
365
366
  return this.fetchWithAuth(input, requestInit, additionalParams);
366
367
  };
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  SaleorAuthClient,
3
3
  createSaleorAuthClient
4
- } from "./chunk-OGC5TPQ2.mjs";
4
+ } from "./chunk-LTHESKMI.mjs";
5
5
  import "./chunk-BZFBMGPG.mjs";
6
6
  import "./chunk-263DHBMK.mjs";
7
7
  import {
@@ -2,7 +2,7 @@ import {
2
2
  SaleorAuthProvider
3
3
  } from "../chunk-74GMXOK4.mjs";
4
4
  import "../chunk-NAQNA6DI.mjs";
5
- import "../chunk-OGC5TPQ2.mjs";
5
+ import "../chunk-LTHESKMI.mjs";
6
6
  import "../chunk-BZFBMGPG.mjs";
7
7
  import "../chunk-263DHBMK.mjs";
8
8
  import "../chunk-UDLCOX6B.mjs";
@@ -3,7 +3,7 @@ import {
3
3
  createSafeContext,
4
4
  useSaleorAuthContext
5
5
  } from "../chunk-NAQNA6DI.mjs";
6
- import "../chunk-OGC5TPQ2.mjs";
6
+ import "../chunk-LTHESKMI.mjs";
7
7
  import "../chunk-BZFBMGPG.mjs";
8
8
  import "../chunk-263DHBMK.mjs";
9
9
  import "../chunk-UDLCOX6B.mjs";
@@ -12,7 +12,7 @@ import {
12
12
  import {
13
13
  useSaleorExternalAuth
14
14
  } from "../chunk-Q3UFWDCC.mjs";
15
- import "../chunk-OGC5TPQ2.mjs";
15
+ import "../chunk-LTHESKMI.mjs";
16
16
  import "../chunk-BZFBMGPG.mjs";
17
17
  import "../chunk-263DHBMK.mjs";
18
18
  import "../chunk-T35JF4IS.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopsbuilder/auth-sdk",
3
- "version": "1.2.1",
3
+ "version": "1.2.3",
4
4
  "description": "Auth SDK for Saleor",
5
5
  "sideEffects": false,
6
6
  "files": ["dist/", "README.md"],