@moontra/moonui-pro 2.37.3 → 2.37.5

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
@@ -2184,17 +2184,35 @@ function MoonUIAuthProvider({ children }) {
2184
2184
  }
2185
2185
  authPromise = (async () => {
2186
2186
  try {
2187
- console.log("[MoonUI Auth] Making API call to validate-pro...");
2188
2187
  lastFetchTime = now;
2189
- const response = await fetch(AUTH_CONFIG.internalEndpoint, {
2190
- method: "GET",
2191
- credentials: "include",
2192
- headers: {
2193
- "Content-Type": "application/json",
2194
- // Add request ID for tracking
2195
- "X-Request-ID": `auth-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`
2188
+ let response;
2189
+ const authServerUrl = typeof window !== "undefined" ? process.env.NEXT_PUBLIC_MOONUI_AUTH_SERVER || "http://localhost:7878" : "http://localhost:7878";
2190
+ try {
2191
+ console.log("[MoonUI Auth] Checking CLI auth server at:", authServerUrl);
2192
+ response = await fetch(`${authServerUrl}/validate`, {
2193
+ method: "GET",
2194
+ headers: {
2195
+ "X-Component": "MoonUIAuthProvider",
2196
+ "X-Timestamp": Date.now().toString()
2197
+ },
2198
+ credentials: "include"
2199
+ });
2200
+ if (response && response.ok) {
2201
+ console.log("[MoonUI Auth] Using CLI auth server");
2202
+ } else {
2203
+ throw new Error("Auth server not available");
2196
2204
  }
2197
- });
2205
+ } catch (error) {
2206
+ console.log("[MoonUI Auth] Auth server not available, falling back to API route");
2207
+ response = await fetch(AUTH_CONFIG.internalEndpoint, {
2208
+ method: "GET",
2209
+ credentials: "include",
2210
+ headers: {
2211
+ "Content-Type": "application/json",
2212
+ "X-Request-ID": `auth-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`
2213
+ }
2214
+ });
2215
+ }
2198
2216
  if (!response.ok) {
2199
2217
  console.error("[MoonUI Auth] Validation failed:", response.status);
2200
2218
  throw new Error(`Validation failed: ${response.status}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moontra/moonui-pro",
3
- "version": "2.37.3",
3
+ "version": "2.37.5",
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",