@moontra/moonui-pro 2.33.13 → 2.33.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.mjs CHANGED
@@ -285,30 +285,39 @@ var init_cli_token_reader = __esm({
285
285
  }
286
286
  }
287
287
  /**
288
- * Validate device compatibility (CLI vs Browser)
288
+ * Validate device compatibility (CLI vs Browser) with hybrid security model
289
289
  * CLI: platform-hostname-userHash-macHash
290
290
  * Browser: platform-hostname-userHash-browserHash
291
- * Compatible if first 3 parts match
291
+ * Security levels:
292
+ * - STRICT: All parts must match (prevent .env.local copying)
293
+ * - HYBRID: First 3 parts match, API validation required for hash differences
292
294
  */
293
295
  validateDeviceCompatibility(tokenDeviceId, currentDeviceId) {
294
296
  const tokenParts = tokenDeviceId.split("-");
295
297
  const currentParts = currentDeviceId.split("-");
296
298
  if (tokenParts.length < 3 || currentParts.length < 3) {
297
- return { compatible: false, reason: "Invalid device ID format" };
299
+ return { compatible: false, requiresAPIValidation: false, reason: "Invalid device ID format" };
298
300
  }
299
301
  const platformMatch = tokenParts[0] === currentParts[0];
300
302
  const hostnameMatch = tokenParts[1] === currentParts[1];
301
303
  const userHashMatch = tokenParts[2] === currentParts[2];
302
304
  if (!platformMatch) {
303
- return { compatible: false, reason: "Platform mismatch (different OS)" };
305
+ return { compatible: false, requiresAPIValidation: false, reason: "Platform mismatch (different OS)" };
304
306
  }
305
307
  if (!hostnameMatch) {
306
- return { compatible: false, reason: "Hostname mismatch (different machine)" };
308
+ return { compatible: false, requiresAPIValidation: false, reason: "Hostname mismatch (different machine)" };
307
309
  }
308
310
  if (!userHashMatch) {
309
- return { compatible: false, reason: "User account mismatch" };
311
+ return { compatible: false, requiresAPIValidation: false, reason: "User account mismatch" };
312
+ }
313
+ const cliMachineHash = tokenParts[3] || "";
314
+ const browserMachineHash = currentParts[3] || "";
315
+ const machineHashMatch = cliMachineHash === browserMachineHash;
316
+ if (machineHashMatch) {
317
+ return { compatible: true, requiresAPIValidation: false };
318
+ } else {
319
+ return { compatible: true, requiresAPIValidation: true };
310
320
  }
311
- return { compatible: true };
312
321
  }
313
322
  /**
314
323
  * SHA256 hash function for consistency with CLI
@@ -427,7 +436,12 @@ var init_cli_token_reader = __esm({
427
436
  console.log(" \u2022 Contact support for multi-device licensing options");
428
437
  return null;
429
438
  }
430
- console.log("[MoonUI Pro] Device compatibility validated successfully");
439
+ if (compatibility.requiresAPIValidation) {
440
+ console.log("[MoonUI Pro] Device hash mismatch detected - performing API validation");
441
+ console.log("[MoonUI Pro] This is normal for CLI-Browser authentication");
442
+ } else {
443
+ console.log("[MoonUI Pro] Perfect device match - skipping API validation");
444
+ }
431
445
  }
432
446
  const isValid2 = await this.validateWithAPI(tokenData.token, tokenDeviceId, currentDeviceId);
433
447
  if (!isValid2) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moontra/moonui-pro",
3
- "version": "2.33.13",
3
+ "version": "2.33.14",
4
4
  "description": "Premium React components for MoonUI - Advanced UI library with 50+ pro components including performance, interactive, and gesture components",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",