@nocios/crudify-ui 3.0.12 → 3.0.14

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
@@ -734,6 +734,18 @@ var SessionManager = class _SessionManager {
734
734
  expiresAt: savedTokens.expiresAt,
735
735
  refreshExpiresAt: savedTokens.refreshExpiresAt
736
736
  });
737
+ try {
738
+ const isValid = import_crudify_browser2.default.isLogin();
739
+ if (!isValid) {
740
+ this.log("Restored tokens are invalid, clearing storage");
741
+ TokenStorage.clearTokens();
742
+ return false;
743
+ }
744
+ } catch (validationError) {
745
+ this.log("Token validation failed:", validationError);
746
+ TokenStorage.clearTokens();
747
+ return false;
748
+ }
737
749
  this.log("Session restored successfully");
738
750
  this.config.onSessionRestored?.(savedTokens);
739
751
  return true;
package/dist/index.mjs CHANGED
@@ -668,6 +668,18 @@ var SessionManager = class _SessionManager {
668
668
  expiresAt: savedTokens.expiresAt,
669
669
  refreshExpiresAt: savedTokens.refreshExpiresAt
670
670
  });
671
+ try {
672
+ const isValid = crudify2.isLogin();
673
+ if (!isValid) {
674
+ this.log("Restored tokens are invalid, clearing storage");
675
+ TokenStorage.clearTokens();
676
+ return false;
677
+ }
678
+ } catch (validationError) {
679
+ this.log("Token validation failed:", validationError);
680
+ TokenStorage.clearTokens();
681
+ return false;
682
+ }
671
683
  this.log("Session restored successfully");
672
684
  this.config.onSessionRestored?.(savedTokens);
673
685
  return true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocios/crudify-ui",
3
- "version": "3.0.12",
3
+ "version": "3.0.14",
4
4
  "description": "Biblioteca de componentes UI para Crudify",
5
5
  "author": "Nocios",
6
6
  "license": "MIT",