@moontra/moonui-pro 2.32.8 → 2.32.10
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 +34 -1
- package/package.json +1 -2
package/dist/index.mjs
CHANGED
|
@@ -92,17 +92,38 @@ function updateGlobalState(newState) {
|
|
|
92
92
|
notifySubscribers();
|
|
93
93
|
}
|
|
94
94
|
async function getAuthToken() {
|
|
95
|
+
const isDevelopment = true;
|
|
96
|
+
const isProduction = false;
|
|
97
|
+
console.log("[MoonUI Pro Auth] Getting auth token...", {
|
|
98
|
+
isDevelopment,
|
|
99
|
+
isProduction,
|
|
100
|
+
hasWindow: typeof window !== "undefined"
|
|
101
|
+
});
|
|
95
102
|
if (typeof window !== "undefined") {
|
|
96
103
|
const browserToken = localStorage.getItem("moonui_auth_token");
|
|
97
104
|
if (browserToken) {
|
|
105
|
+
console.log("[MoonUI Pro Auth] Found token in localStorage (dev)");
|
|
98
106
|
return browserToken;
|
|
99
107
|
}
|
|
108
|
+
console.log("[MoonUI Pro Auth] No token in localStorage (dev)");
|
|
100
109
|
}
|
|
101
|
-
|
|
110
|
+
const envToken = process.env.NEXT_PUBLIC_MOONUI_AUTH_TOKEN || process.env.NEXT_PUBLIC_MOONUI_LICENSE_KEY;
|
|
111
|
+
console.log("[MoonUI Pro Auth] Checking env variables:", {
|
|
112
|
+
hasPublicToken: !!process.env.NEXT_PUBLIC_MOONUI_AUTH_TOKEN,
|
|
113
|
+
hasLicenseKey: !!process.env.NEXT_PUBLIC_MOONUI_LICENSE_KEY,
|
|
114
|
+
result: envToken ? "Found" : "Not found"
|
|
115
|
+
});
|
|
116
|
+
return envToken || null;
|
|
102
117
|
}
|
|
103
118
|
async function validateLicense() {
|
|
104
119
|
const token = await getAuthToken();
|
|
120
|
+
console.log("[MoonUI Pro Auth] Validating license:", {
|
|
121
|
+
hasToken: !!token,
|
|
122
|
+
tokenLength: token ? token.length : 0,
|
|
123
|
+
tokenPreview: token ? `${token.substring(0, 10)}...` : "null"
|
|
124
|
+
});
|
|
105
125
|
if (!token) {
|
|
126
|
+
console.log("[MoonUI Pro Auth] No token found, clearing cache");
|
|
106
127
|
if (typeof window !== "undefined") {
|
|
107
128
|
localStorage.removeItem(CACHE_KEY);
|
|
108
129
|
}
|
|
@@ -114,6 +135,7 @@ async function validateLicense() {
|
|
|
114
135
|
return;
|
|
115
136
|
}
|
|
116
137
|
try {
|
|
138
|
+
console.log("[MoonUI Pro Auth] Calling validate API...");
|
|
117
139
|
const response = await fetch("https://moonui.dev/api/auth/validate", {
|
|
118
140
|
headers: {
|
|
119
141
|
"Authorization": `Bearer ${token}`
|
|
@@ -121,6 +143,12 @@ async function validateLicense() {
|
|
|
121
143
|
});
|
|
122
144
|
if (response.ok) {
|
|
123
145
|
const data = await response.json();
|
|
146
|
+
console.log("[MoonUI Pro Auth] API Response:", {
|
|
147
|
+
valid: data.valid,
|
|
148
|
+
hasLifetimeAccess: data.user?.hasLifetimeAccess,
|
|
149
|
+
features: data.user?.features,
|
|
150
|
+
plan: data.user?.plan
|
|
151
|
+
});
|
|
124
152
|
const cacheData = {
|
|
125
153
|
valid: data.valid,
|
|
126
154
|
hasLifetimeAccess: data.user?.hasLifetimeAccess || false,
|
|
@@ -131,6 +159,10 @@ async function validateLicense() {
|
|
|
131
159
|
localStorage.setItem(CACHE_KEY, JSON.stringify(cacheData));
|
|
132
160
|
}
|
|
133
161
|
const hasProAccess = data.valid && (data.user?.hasLifetimeAccess || data.user?.features?.includes("pro_components"));
|
|
162
|
+
console.log("[MoonUI Pro Auth] Access result:", {
|
|
163
|
+
hasProAccess,
|
|
164
|
+
isAuthenticated: data.valid
|
|
165
|
+
});
|
|
134
166
|
updateGlobalState({
|
|
135
167
|
hasProAccess,
|
|
136
168
|
isAuthenticated: data.valid,
|
|
@@ -142,6 +174,7 @@ async function validateLicense() {
|
|
|
142
174
|
isLoading: false
|
|
143
175
|
});
|
|
144
176
|
} else {
|
|
177
|
+
console.log("[MoonUI Pro Auth] Invalid response:", response.status);
|
|
145
178
|
if (typeof window !== "undefined") {
|
|
146
179
|
localStorage.removeItem(CACHE_KEY);
|
|
147
180
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moontra/moonui-pro",
|
|
3
|
-
"version": "2.32.
|
|
3
|
+
"version": "2.32.10",
|
|
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",
|
|
@@ -81,7 +81,6 @@
|
|
|
81
81
|
"react-dom": ">=18.0.0 || ^19.0.0"
|
|
82
82
|
},
|
|
83
83
|
"dependencies": {
|
|
84
|
-
"@moontra/moonui-pro": "^2.32.3",
|
|
85
84
|
"@radix-ui/react-accordion": "^1.2.11",
|
|
86
85
|
"@radix-ui/react-avatar": "^1.1.10",
|
|
87
86
|
"@radix-ui/react-checkbox": "^1.3.2",
|