@trops/dash-core 0.1.206 → 0.1.208

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.
@@ -29738,7 +29738,7 @@ async function getRegistryProfile$2() {
29738
29738
 
29739
29739
  if (response.status === 401) {
29740
29740
  // Token expired or invalid — clear stored credentials
29741
- clearToken();
29741
+ clearToken$1();
29742
29742
  return null;
29743
29743
  }
29744
29744
  if (!response.ok) return null;
@@ -29753,7 +29753,7 @@ async function getRegistryProfile$2() {
29753
29753
  /**
29754
29754
  * Clear stored auth token (logout).
29755
29755
  */
29756
- function clearToken() {
29756
+ function clearToken$1() {
29757
29757
  try {
29758
29758
  const s = getStore$1();
29759
29759
  s.clear();
@@ -29784,7 +29784,7 @@ async function updateRegistryProfile$1(updates) {
29784
29784
  });
29785
29785
 
29786
29786
  if (response.status === 401) {
29787
- clearToken();
29787
+ clearToken$1();
29788
29788
  return null;
29789
29789
  }
29790
29790
  if (!response.ok) return null;
@@ -29813,7 +29813,7 @@ async function getRegistryPackages$1() {
29813
29813
  });
29814
29814
 
29815
29815
  if (response.status === 401) {
29816
- clearToken();
29816
+ clearToken$1();
29817
29817
  return null;
29818
29818
  }
29819
29819
  if (!response.ok) return null;
@@ -29850,7 +29850,7 @@ async function updateRegistryPackage$1(scope, name, updates) {
29850
29850
  );
29851
29851
 
29852
29852
  if (response.status === 401) {
29853
- clearToken();
29853
+ clearToken$1();
29854
29854
  return null;
29855
29855
  }
29856
29856
  if (!response.ok) return null;
@@ -29884,7 +29884,7 @@ async function deleteRegistryPackage(scope, name) {
29884
29884
  );
29885
29885
 
29886
29886
  if (response.status === 401) {
29887
- clearToken();
29887
+ clearToken$1();
29888
29888
  return null;
29889
29889
  }
29890
29890
  if (!response.ok) return null;
@@ -29905,7 +29905,7 @@ var registryAuthController$1 = {
29905
29905
  getRegistryPackages: getRegistryPackages$1,
29906
29906
  updateRegistryPackage: updateRegistryPackage$1,
29907
29907
  deleteRegistryPackage,
29908
- clearToken,
29908
+ clearToken: clearToken$1,
29909
29909
  };
29910
29910
 
29911
29911
  var widgetRegistry$1 = {exports: {}};
@@ -32324,7 +32324,7 @@ const {
32324
32324
  applyEventWiringToLayout,
32325
32325
  } = dashboardConfigUtils$1;
32326
32326
  const { searchRegistry, getPackage } = registryController$3;
32327
- const { getStoredToken } = registryAuthController$1;
32327
+ const { getStoredToken, clearToken } = registryAuthController$1;
32328
32328
  const themeController$3 = themeController_1;
32329
32329
 
32330
32330
  const configFilename = "workspaces.json";
@@ -32949,12 +32949,27 @@ async function installDashboardFromRegistry$1(
32949
32949
  );
32950
32950
 
32951
32951
  // Download the ZIP (with auth header)
32952
- const headers = {};
32953
32952
  const auth = getStoredToken();
32953
+ if (!auth) {
32954
+ return {
32955
+ success: false,
32956
+ error: "Not authenticated with registry",
32957
+ authRequired: true,
32958
+ };
32959
+ }
32960
+ const headers = {};
32954
32961
  if (auth?.token) {
32955
32962
  headers["Authorization"] = `Bearer ${auth.token}`;
32956
32963
  }
32957
32964
  const response = await fetch(downloadUrl, { headers });
32965
+ if (response.status === 401) {
32966
+ clearToken();
32967
+ return {
32968
+ success: false,
32969
+ error: "Authentication expired. Please sign in again.",
32970
+ authRequired: true,
32971
+ };
32972
+ }
32958
32973
  if (!response.ok) {
32959
32974
  return {
32960
32975
  success: false,