@moontra/moonui-pro 2.33.13 → 2.33.15
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.global.js +1 -1
- package/dist/index.global.js.map +1 -1
- package/dist/index.mjs +29 -9
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -157,7 +157,7 @@ var init_cli_token_reader = __esm({
|
|
|
157
157
|
return hash.substring(0, 8);
|
|
158
158
|
} catch (error) {
|
|
159
159
|
console.warn("[MoonUI Pro] Browser user hash generation failed, using fallback");
|
|
160
|
-
const fallback = `${navigator.userAgent.length}-${screen.width}-${
|
|
160
|
+
const fallback = `${navigator.userAgent.length}-${screen.width}-${navigator.language}`;
|
|
161
161
|
return this.fallbackHash(fallback);
|
|
162
162
|
}
|
|
163
163
|
}
|
|
@@ -285,30 +285,45 @@ 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
|
-
*
|
|
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];
|
|
304
|
+
console.log("[MoonUI Pro] Device ID comparison:", {
|
|
305
|
+
platform: { token: tokenParts[0], current: currentParts[0], match: platformMatch },
|
|
306
|
+
hostname: { token: tokenParts[1], current: currentParts[1], match: hostnameMatch },
|
|
307
|
+
userHash: { token: tokenParts[2], current: currentParts[2], match: userHashMatch },
|
|
308
|
+
machineHash: { token: tokenParts[3], current: currentParts[3], match: tokenParts[3] === currentParts[3] }
|
|
309
|
+
});
|
|
302
310
|
if (!platformMatch) {
|
|
303
|
-
return { compatible: false, reason:
|
|
311
|
+
return { compatible: false, requiresAPIValidation: false, reason: `Platform mismatch: token=${tokenParts[0]}, current=${currentParts[0]}` };
|
|
304
312
|
}
|
|
305
313
|
if (!hostnameMatch) {
|
|
306
|
-
return { compatible: false, reason:
|
|
314
|
+
return { compatible: false, requiresAPIValidation: false, reason: `Hostname mismatch: token=${tokenParts[1]}, current=${currentParts[1]}` };
|
|
307
315
|
}
|
|
308
316
|
if (!userHashMatch) {
|
|
309
|
-
return { compatible: false, reason:
|
|
317
|
+
return { compatible: false, requiresAPIValidation: false, reason: `User hash mismatch: token=${tokenParts[2]}, current=${currentParts[2]}` };
|
|
318
|
+
}
|
|
319
|
+
const cliMachineHash = tokenParts[3] || "";
|
|
320
|
+
const browserMachineHash = currentParts[3] || "";
|
|
321
|
+
const machineHashMatch = cliMachineHash === browserMachineHash;
|
|
322
|
+
if (machineHashMatch) {
|
|
323
|
+
return { compatible: true, requiresAPIValidation: false };
|
|
324
|
+
} else {
|
|
325
|
+
return { compatible: true, requiresAPIValidation: true };
|
|
310
326
|
}
|
|
311
|
-
return { compatible: true };
|
|
312
327
|
}
|
|
313
328
|
/**
|
|
314
329
|
* SHA256 hash function for consistency with CLI
|
|
@@ -427,7 +442,12 @@ var init_cli_token_reader = __esm({
|
|
|
427
442
|
console.log(" \u2022 Contact support for multi-device licensing options");
|
|
428
443
|
return null;
|
|
429
444
|
}
|
|
430
|
-
|
|
445
|
+
if (compatibility.requiresAPIValidation) {
|
|
446
|
+
console.log("[MoonUI Pro] Device hash mismatch detected - performing API validation");
|
|
447
|
+
console.log("[MoonUI Pro] This is normal for CLI-Browser authentication");
|
|
448
|
+
} else {
|
|
449
|
+
console.log("[MoonUI Pro] Perfect device match - skipping API validation");
|
|
450
|
+
}
|
|
431
451
|
}
|
|
432
452
|
const isValid2 = await this.validateWithAPI(tokenData.token, tokenDeviceId, currentDeviceId);
|
|
433
453
|
if (!isValid2) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moontra/moonui-pro",
|
|
3
|
-
"version": "2.33.
|
|
3
|
+
"version": "2.33.15",
|
|
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",
|