@moontra/moonui-pro 2.33.4 → 2.33.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
@@ -2780,6 +2780,8 @@ function SubscriptionProvider({ children }) {
2780
2780
  const [hasProAccess, setHasProAccess] = useState(false);
2781
2781
  const [isAuthenticated, setIsAuthenticated] = useState(false);
2782
2782
  const [lastCheckTime, setLastCheckTime] = useState(0);
2783
+ const [authCheckInterval, setAuthCheckInterval] = useState(null);
2784
+ const [hasAuthError, setHasAuthError] = useState(false);
2783
2785
  const getAuthToken2 = async () => {
2784
2786
  if (process.env.VERCEL) {
2785
2787
  return process.env.NEXT_PUBLIC_MOONUI_AUTH_TOKEN || process.env.MOONUI_LICENSE_KEY || null;
@@ -2796,9 +2798,14 @@ function SubscriptionProvider({ children }) {
2796
2798
  try {
2797
2799
  const decoded = JSON.parse(atob(devToken));
2798
2800
  const jwtToken = decoded.token;
2801
+ const userAgent = navigator.userAgent.toLowerCase();
2802
+ const platform2 = userAgent.includes("mac") ? "darwin" : userAgent.includes("win") ? "win32" : "linux";
2803
+ const hostname = window.location.hostname.replace(/\./g, "");
2804
+ const userHash = deviceId.split("-")[2];
2805
+ const browserHash = Math.random().toString(36).substring(2, 8);
2799
2806
  const requestBody = {
2800
2807
  deviceId,
2801
- browserDeviceId: `browser-${navigator.userAgent.substring(0, 10).replace(/[^a-zA-Z0-9]/g, "")}-${Date.now()}`,
2808
+ browserDeviceId: `${platform2}-${hostname}-${userHash}-${browserHash}`,
2802
2809
  timestamp: Date.now(),
2803
2810
  validationType: "hybrid-strict"
2804
2811
  };
@@ -2825,6 +2832,18 @@ function SubscriptionProvider({ children }) {
2825
2832
  } else {
2826
2833
  const errorData = await response.text();
2827
2834
  console.error("[MoonUI Pro] API Error:", response.status, errorData);
2835
+ try {
2836
+ const errorObj = JSON.parse(errorData);
2837
+ if (errorObj.reason === "browser-fingerprint-invalid" || errorObj.reason === "cli-session-missing" || response.status === 401) {
2838
+ console.error("[MoonUI Pro] Critical auth error - stopping retry attempts");
2839
+ setHasAuthError(true);
2840
+ if (authCheckInterval) {
2841
+ clearInterval(authCheckInterval);
2842
+ setAuthCheckInterval(null);
2843
+ }
2844
+ }
2845
+ } catch (e) {
2846
+ }
2828
2847
  }
2829
2848
  } catch (error) {
2830
2849
  {
@@ -2934,17 +2953,25 @@ function SubscriptionProvider({ children }) {
2934
2953
  };
2935
2954
  useEffect(() => {
2936
2955
  checkAccess();
2937
- {
2956
+ if (!hasAuthError) {
2938
2957
  const interval = setInterval(() => {
2939
- console.log("[MoonUI Pro] Running periodic auth check...");
2940
- if (typeof window !== "undefined") {
2941
- localStorage.removeItem(CACHE_KEY2);
2958
+ if (!hasAuthError) {
2959
+ console.log("[MoonUI Pro] Running periodic auth check...");
2960
+ validateLicense2().catch((error) => {
2961
+ console.error("[MoonUI Pro] Periodic auth check failed:", error);
2962
+ });
2963
+ } else {
2964
+ console.log("[MoonUI Pro] Auth check disabled due to critical error");
2965
+ clearInterval(interval);
2942
2966
  }
2943
- validateLicense2().catch(console.error);
2944
2967
  }, CHECK_INTERVAL);
2945
- return () => clearInterval(interval);
2968
+ setAuthCheckInterval(interval);
2969
+ return () => {
2970
+ if (interval)
2971
+ clearInterval(interval);
2972
+ };
2946
2973
  }
2947
- }, []);
2974
+ }, [hasAuthError]);
2948
2975
  const value = {
2949
2976
  isLoading,
2950
2977
  hasProAccess,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moontra/moonui-pro",
3
- "version": "2.33.4",
3
+ "version": "2.33.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",