@iblai/web-utils 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/index.js CHANGED
@@ -3014,9 +3014,17 @@ function useAuthProvider({ middleware = new Map(), onAuthSuccess, onAuthFailure,
3014
3014
  const dmTokenInLocalStorage = await storageService.getItem(LOCAL_STORAGE_KEYS.DM_TOKEN_KEY);
3015
3015
  const dmTokenExpired = await isDmTokenExpired(storageService);
3016
3016
  if (!dmTokenInLocalStorage || dmTokenExpired) {
3017
- console.log("[auth-redirect] DM token has expired, forcing logout");
3017
+ console.log();
3018
+ if (!!dmTokenInLocalStorage) {
3019
+ console.log("[auth-redirect] DM token doesn't exists");
3020
+ }
3021
+ else {
3022
+ console.log("[auth-redirect] DM token doesn't exists, forcing logout");
3023
+ }
3018
3024
  // Clear all auth-related storage keys
3019
- clearAuthCookies();
3025
+ if (!!dmTokenInLocalStorage) {
3026
+ clearAuthCookies();
3027
+ }
3020
3028
  const reason = "DM token expired";
3021
3029
  onAuthFailure === null || onAuthFailure === void 0 ? void 0 : onAuthFailure(reason);
3022
3030
  safeRedirectToAuthSpa(undefined, undefined, !!dmTokenInLocalStorage); // with no dm token at all in storage, don't force logout