@moontra/moonui-pro 2.32.34 → 2.32.35
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.d.ts +1 -1
- package/dist/index.global.js +1 -1
- package/dist/index.global.js.map +1 -1
- package/dist/index.mjs +57 -17
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -100,27 +100,26 @@ var init_cli_token_reader = __esm({
|
|
|
100
100
|
return this.instance;
|
|
101
101
|
}
|
|
102
102
|
/**
|
|
103
|
-
* Generate secure device fingerprint
|
|
104
|
-
*
|
|
103
|
+
* Generate TRULY secure browser-specific device fingerprint
|
|
104
|
+
* COMPLETELY INDEPENDENT from environment variables
|
|
105
|
+
* Format: browser-hostname-browser_user_hash-machine_hash
|
|
105
106
|
*
|
|
106
|
-
* SECURITY:
|
|
107
|
+
* SECURITY: Environment copying CANNOT bypass this!
|
|
107
108
|
*/
|
|
108
109
|
async getDeviceFingerprint() {
|
|
109
110
|
try {
|
|
110
111
|
const platform2 = this.detectBrowserPlatform();
|
|
111
|
-
const hostname =
|
|
112
|
-
const
|
|
113
|
-
const usernameHash = await this.sha256Hash(username);
|
|
112
|
+
const hostname = typeof window !== "undefined" ? window.location.hostname : "unknown";
|
|
113
|
+
const browserUserHash = await this.generateBrowserSpecificUserHash();
|
|
114
114
|
const browserMachineId = await this.generateBrowserMachineId();
|
|
115
|
-
const fingerprint =
|
|
116
|
-
console.log("[MoonUI Pro]
|
|
115
|
+
const fingerprint = `browser-${hostname}-${browserUserHash}-${browserMachineId}`;
|
|
116
|
+
console.log("[MoonUI Pro] Environment-independent browser fingerprint generated:", {
|
|
117
117
|
platform: platform2,
|
|
118
118
|
hostname,
|
|
119
|
-
|
|
120
|
-
usernameHash,
|
|
119
|
+
browserUserHash: browserUserHash.substring(0, 4) + "***",
|
|
121
120
|
browserMachineId: browserMachineId.substring(0, 4) + "***",
|
|
122
|
-
fingerprint: fingerprint.substring(0,
|
|
123
|
-
security: "
|
|
121
|
+
fingerprint: fingerprint.substring(0, 30) + "***",
|
|
122
|
+
security: "environment-independent"
|
|
124
123
|
});
|
|
125
124
|
return fingerprint;
|
|
126
125
|
} catch (error) {
|
|
@@ -128,6 +127,40 @@ var init_cli_token_reader = __esm({
|
|
|
128
127
|
return "browser-fallback-device";
|
|
129
128
|
}
|
|
130
129
|
}
|
|
130
|
+
/**
|
|
131
|
+
* Generate browser-specific user hash independent of environment
|
|
132
|
+
* Uses browser characteristics to create unique user identifier
|
|
133
|
+
*/
|
|
134
|
+
async generateBrowserSpecificUserHash() {
|
|
135
|
+
try {
|
|
136
|
+
const characteristics = [
|
|
137
|
+
// Browser identity
|
|
138
|
+
navigator.userAgent,
|
|
139
|
+
navigator.language,
|
|
140
|
+
navigator.languages?.join(",") || "",
|
|
141
|
+
// System characteristics
|
|
142
|
+
`${screen.width}x${screen.height}x${screen.colorDepth}`,
|
|
143
|
+
`${window.devicePixelRatio || 1}`,
|
|
144
|
+
// Hardware info
|
|
145
|
+
`${navigator.hardwareConcurrency || 0}`,
|
|
146
|
+
`${navigator.maxTouchPoints || 0}`,
|
|
147
|
+
// Timezone and locale
|
|
148
|
+
Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
149
|
+
Intl.DateTimeFormat().resolvedOptions().locale,
|
|
150
|
+
// Browser capabilities
|
|
151
|
+
typeof window.WebGL2RenderingContext !== "undefined" ? "webgl2" : "webgl1",
|
|
152
|
+
typeof window.AudioContext !== "undefined" ? "audio" : "no-audio",
|
|
153
|
+
typeof navigator.serviceWorker !== "undefined" ? "sw" : "no-sw"
|
|
154
|
+
];
|
|
155
|
+
const combined = characteristics.join("|");
|
|
156
|
+
const hash = await this.sha256Hash(combined);
|
|
157
|
+
return hash.substring(0, 8);
|
|
158
|
+
} catch (error) {
|
|
159
|
+
console.warn("[MoonUI Pro] Browser user hash generation failed, using fallback");
|
|
160
|
+
const fallback = `${navigator.userAgent.length}-${screen.width}-${Date.now() % 1e4}`;
|
|
161
|
+
return this.fallbackHash(fallback);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
131
164
|
/**
|
|
132
165
|
* Detect platform in browser environment (CLI compatible)
|
|
133
166
|
*/
|
|
@@ -323,9 +356,9 @@ var init_cli_token_reader = __esm({
|
|
|
323
356
|
}
|
|
324
357
|
}
|
|
325
358
|
/**
|
|
326
|
-
* Validate token with backend API
|
|
359
|
+
* Validate token with backend API using strict dual device validation
|
|
327
360
|
*/
|
|
328
|
-
async validateWithAPI(token,
|
|
361
|
+
async validateWithAPI(token, tokenDeviceId, browserDeviceId) {
|
|
329
362
|
try {
|
|
330
363
|
const response = await fetch("https://moonui.dev/api/cli/validate-session", {
|
|
331
364
|
method: "POST",
|
|
@@ -334,8 +367,13 @@ var init_cli_token_reader = __esm({
|
|
|
334
367
|
"Content-Type": "application/json"
|
|
335
368
|
},
|
|
336
369
|
body: JSON.stringify({
|
|
337
|
-
deviceId,
|
|
338
|
-
|
|
370
|
+
deviceId: tokenDeviceId,
|
|
371
|
+
// CLI device ID from token
|
|
372
|
+
browserDeviceId,
|
|
373
|
+
// Current browser device ID
|
|
374
|
+
timestamp: Date.now(),
|
|
375
|
+
validationType: "hybrid-strict"
|
|
376
|
+
// New validation type
|
|
339
377
|
})
|
|
340
378
|
});
|
|
341
379
|
if (!response.ok) {
|
|
@@ -391,7 +429,7 @@ var init_cli_token_reader = __esm({
|
|
|
391
429
|
}
|
|
392
430
|
console.log("[MoonUI Pro] Device compatibility validated successfully");
|
|
393
431
|
}
|
|
394
|
-
const isValid2 = await this.validateWithAPI(tokenData.token, tokenDeviceId
|
|
432
|
+
const isValid2 = await this.validateWithAPI(tokenData.token, tokenDeviceId, currentDeviceId);
|
|
395
433
|
if (!isValid2) {
|
|
396
434
|
console.error("[MoonUI Pro] Device session validation failed");
|
|
397
435
|
console.log("[MoonUI Pro] This may happen if:");
|
|
@@ -399,6 +437,8 @@ var init_cli_token_reader = __esm({
|
|
|
399
437
|
console.log(" \u2022 Device limit exceeded");
|
|
400
438
|
console.log(" \u2022 Session expired");
|
|
401
439
|
console.log(" \u2022 Device was revoked from dashboard");
|
|
440
|
+
console.log(" \u2022 Token was copied from another device (strict security)");
|
|
441
|
+
console.log(" \u2022 Browser fingerprint doesn't match session");
|
|
402
442
|
console.log(' \u2022 Run "moonui login" to create a new session');
|
|
403
443
|
return null;
|
|
404
444
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moontra/moonui-pro",
|
|
3
|
-
"version": "2.32.
|
|
3
|
+
"version": "2.32.35",
|
|
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",
|