@moontra/moonui-pro 2.32.41 → 2.32.42

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
@@ -3006,41 +3006,16 @@ function SubscriptionProvider({ children }) {
3006
3006
  const [isAuthenticated, setIsAuthenticated] = useState(false);
3007
3007
  const [lastCheckTime, setLastCheckTime] = useState(0);
3008
3008
  const getAuthToken2 = async () => {
3009
- if (process.env.VERCEL) {
3010
- return process.env.NEXT_PUBLIC_MOONUI_AUTH_TOKEN || process.env.MOONUI_LICENSE_KEY || null;
3011
- }
3012
- {
3013
- if (typeof window !== "undefined") {
3014
- const browserToken = localStorage.getItem("moonui_auth_token");
3015
- if (browserToken) {
3016
- return browserToken;
3017
- }
3018
- try {
3019
- const response = await fetch("https://moonui.dev/api/cli/validate-session", {
3020
- method: "POST",
3021
- headers: {
3022
- "Content-Type": "application/json"
3023
- },
3024
- body: JSON.stringify({
3025
- validationType: "browser-only"
3026
- })
3027
- });
3028
- if (response.ok) {
3029
- const data = await response.json();
3030
- if (data.authenticated && data.hasProAccess) {
3031
- return "cli-authenticated-pro";
3032
- } else if (data.authenticated) {
3033
- return null;
3034
- }
3035
- }
3036
- } catch (error) {
3037
- {
3038
- console.debug("[MoonUI Pro Context] CLI auth check via moonui.dev failed:", error);
3039
- }
3040
- }
3009
+ if (typeof window !== "undefined") {
3010
+ const browserToken = localStorage.getItem("moonui_auth_token");
3011
+ if (browserToken) {
3012
+ return browserToken;
3041
3013
  }
3042
3014
  }
3043
- return process.env.NEXT_PUBLIC_MOONUI_AUTH_TOKEN || process.env.MOONUI_LICENSE_KEY || null;
3015
+ const devToken = process.env.NEXT_PUBLIC_MOONUI_DEV_TOKEN;
3016
+ const authToken = process.env.NEXT_PUBLIC_MOONUI_AUTH_TOKEN;
3017
+ const licenseKey = process.env.MOONUI_LICENSE_KEY;
3018
+ return devToken || authToken || licenseKey || null;
3044
3019
  };
3045
3020
  const validateLicense2 = async () => {
3046
3021
  const token = await getAuthToken2();
@@ -3067,10 +3042,14 @@ function SubscriptionProvider({ children }) {
3067
3042
  return;
3068
3043
  }
3069
3044
  try {
3070
- const response = await fetch("https://moonui.dev/api/auth/validate", {
3045
+ const apiUrl = typeof window !== "undefined" && window.location.origin ? `${window.location.origin}/api/cli/validate-session` : "https://moonui.dev/api/auth/validate";
3046
+ const response = await fetch(apiUrl, {
3047
+ method: "POST",
3071
3048
  headers: {
3049
+ "Content-Type": "application/json",
3072
3050
  "Authorization": `Bearer ${token}`
3073
- }
3051
+ },
3052
+ body: JSON.stringify({ token })
3074
3053
  });
3075
3054
  if (response.ok) {
3076
3055
  const data = await response.json();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moontra/moonui-pro",
3
- "version": "2.32.41",
3
+ "version": "2.32.42",
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",