@iblai/web-utils 1.10.2 → 1.10.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.
package/dist/index.js CHANGED
@@ -9389,10 +9389,11 @@ function useAuthProvider({ middleware = new Map(), onAuthSuccess, onAuthFailure,
9389
9389
  var _a;
9390
9390
  try {
9391
9391
  setIsAuthenticating(true);
9392
- if ((storageService === null || storageService === void 0 ? void 0 : storageService.getItem(LOCAL_STORAGE_KEYS.AUTH_TOKEN)) && !hasNonExpiredAuthToken()) {
9392
+ const authToken = await (storageService === null || storageService === void 0 ? void 0 : storageService.getItem(LOCAL_STORAGE_KEYS.AUTH_TOKEN));
9393
+ if (authToken && !hasNonExpiredAuthToken()) {
9393
9394
  const reason = "Auth token expired";
9394
9395
  onAuthFailure === null || onAuthFailure === void 0 ? void 0 : onAuthFailure(reason);
9395
- console.log("[auth-redirect] Auth token has expired", storageService === null || storageService === void 0 ? void 0 : storageService.getItem(LOCAL_STORAGE_KEYS.AUTH_TOKEN));
9396
+ console.log("[auth-redirect] Auth token has expired");
9396
9397
  safeRedirectToAuthSpa(undefined, undefined, true);
9397
9398
  return;
9398
9399
  }