@moontra/moonui-pro 2.33.4 → 2.33.6
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 +51 -51
- package/dist/index.global.js.map +1 -1
- package/dist/index.mjs +33 -8
- package/package.json +1 -1
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,12 @@ function SubscriptionProvider({ children }) {
|
|
|
2796
2798
|
try {
|
|
2797
2799
|
const decoded = JSON.parse(atob(devToken));
|
|
2798
2800
|
const jwtToken = decoded.token;
|
|
2801
|
+
const hostname = window.location.hostname.replace(/\./g, "");
|
|
2802
|
+
const userHash = deviceId.split("-")[2];
|
|
2803
|
+
const browserHash = Math.random().toString(36).substring(2, 8);
|
|
2799
2804
|
const requestBody = {
|
|
2800
2805
|
deviceId,
|
|
2801
|
-
browserDeviceId: `browser-${
|
|
2806
|
+
browserDeviceId: `browser-${hostname}-${userHash}-${browserHash}`,
|
|
2802
2807
|
timestamp: Date.now(),
|
|
2803
2808
|
validationType: "hybrid-strict"
|
|
2804
2809
|
};
|
|
@@ -2825,6 +2830,18 @@ function SubscriptionProvider({ children }) {
|
|
|
2825
2830
|
} else {
|
|
2826
2831
|
const errorData = await response.text();
|
|
2827
2832
|
console.error("[MoonUI Pro] API Error:", response.status, errorData);
|
|
2833
|
+
try {
|
|
2834
|
+
const errorObj = JSON.parse(errorData);
|
|
2835
|
+
if (errorObj.reason === "browser-fingerprint-invalid" || errorObj.reason === "cli-session-missing" || response.status === 401) {
|
|
2836
|
+
console.error("[MoonUI Pro] Critical auth error - stopping retry attempts");
|
|
2837
|
+
setHasAuthError(true);
|
|
2838
|
+
if (authCheckInterval) {
|
|
2839
|
+
clearInterval(authCheckInterval);
|
|
2840
|
+
setAuthCheckInterval(null);
|
|
2841
|
+
}
|
|
2842
|
+
}
|
|
2843
|
+
} catch (e) {
|
|
2844
|
+
}
|
|
2828
2845
|
}
|
|
2829
2846
|
} catch (error) {
|
|
2830
2847
|
{
|
|
@@ -2934,17 +2951,25 @@ function SubscriptionProvider({ children }) {
|
|
|
2934
2951
|
};
|
|
2935
2952
|
useEffect(() => {
|
|
2936
2953
|
checkAccess();
|
|
2937
|
-
{
|
|
2954
|
+
if (!hasAuthError) {
|
|
2938
2955
|
const interval = setInterval(() => {
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2956
|
+
if (!hasAuthError) {
|
|
2957
|
+
console.log("[MoonUI Pro] Running periodic auth check...");
|
|
2958
|
+
validateLicense2().catch((error) => {
|
|
2959
|
+
console.error("[MoonUI Pro] Periodic auth check failed:", error);
|
|
2960
|
+
});
|
|
2961
|
+
} else {
|
|
2962
|
+
console.log("[MoonUI Pro] Auth check disabled due to critical error");
|
|
2963
|
+
clearInterval(interval);
|
|
2942
2964
|
}
|
|
2943
|
-
validateLicense2().catch(console.error);
|
|
2944
2965
|
}, CHECK_INTERVAL);
|
|
2945
|
-
|
|
2966
|
+
setAuthCheckInterval(interval);
|
|
2967
|
+
return () => {
|
|
2968
|
+
if (interval)
|
|
2969
|
+
clearInterval(interval);
|
|
2970
|
+
};
|
|
2946
2971
|
}
|
|
2947
|
-
}, []);
|
|
2972
|
+
}, [hasAuthError]);
|
|
2948
2973
|
const value = {
|
|
2949
2974
|
isLoading,
|
|
2950
2975
|
hasProAccess,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moontra/moonui-pro",
|
|
3
|
-
"version": "2.33.
|
|
3
|
+
"version": "2.33.6",
|
|
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",
|