@moontra/moonui-pro 3.2.0 → 3.2.2
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/package.json +1 -1
- package/scripts/postinstall.cjs +26 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moontra/moonui-pro",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.2",
|
|
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",
|
package/scripts/postinstall.cjs
CHANGED
|
@@ -50,10 +50,31 @@ function encryptToken(token, key) {
|
|
|
50
50
|
// Validate license with MoonUI API
|
|
51
51
|
async function validateLicense(licenseKey) {
|
|
52
52
|
return new Promise((resolve, reject) => {
|
|
53
|
+
// Determine the domain
|
|
54
|
+
let domain = 'unknown';
|
|
55
|
+
|
|
56
|
+
// Check for Vercel deployment
|
|
57
|
+
if (process.env.VERCEL_URL) {
|
|
58
|
+
domain = process.env.VERCEL_URL.replace(/^https?:\/\//, '');
|
|
59
|
+
} else if (process.env.VERCEL_PROJECT_PRODUCTION_URL) {
|
|
60
|
+
domain = process.env.VERCEL_PROJECT_PRODUCTION_URL.replace(/^https?:\/\//, '');
|
|
61
|
+
} else if (process.env.NEXT_PUBLIC_VERCEL_URL) {
|
|
62
|
+
domain = process.env.NEXT_PUBLIC_VERCEL_URL.replace(/^https?:\/\//, '');
|
|
63
|
+
} else if (process.env.DEPLOY_URL) {
|
|
64
|
+
domain = process.env.DEPLOY_URL.replace(/^https?:\/\//, '');
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// For moonui.dev site, use special validation
|
|
68
|
+
const isMoonUISite = domain.includes('moonui.dev') ||
|
|
69
|
+
domain.includes('moonui-git') ||
|
|
70
|
+
domain.includes('moonui-') ||
|
|
71
|
+
process.env.MOONUI_SITE === 'true';
|
|
72
|
+
|
|
53
73
|
const postData = JSON.stringify({
|
|
54
74
|
licenseKey,
|
|
55
|
-
domain:
|
|
56
|
-
environment: 'production'
|
|
75
|
+
domain: isMoonUISite ? 'moonui.dev' : domain,
|
|
76
|
+
environment: 'production',
|
|
77
|
+
isMoonUISite
|
|
57
78
|
});
|
|
58
79
|
|
|
59
80
|
const options = {
|
|
@@ -142,6 +163,9 @@ async function main() {
|
|
|
142
163
|
|
|
143
164
|
console.log('[MoonUI Pro] Production environment detected, checking license...');
|
|
144
165
|
|
|
166
|
+
// Remove the bypass - moonui.dev should also use license key like everyone else
|
|
167
|
+
// This prevents security vulnerability where users can set VERCEL_URL=moonui.dev
|
|
168
|
+
|
|
145
169
|
// Check for license key in environment variables
|
|
146
170
|
const licenseKey = process.env.MOONUI_LICENSE_KEY ||
|
|
147
171
|
process.env.NEXT_PUBLIC_MOONUI_LICENSE_KEY ||
|