strapi-plugin-magic-link-v5 5.5.7 → 5.5.8
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/CHANGELOG.md +7 -0
- package/README.md +28 -47
- package/dist/_chunks/LicenseGuard-CiyjFnrw.js +54 -0
- package/dist/_chunks/LicenseGuard-DJ5fq2UZ.mjs +55 -0
- package/dist/_chunks/{index-PgHpSdc8.js → index-01GHNxSr.js} +6 -35
- package/dist/_chunks/{index-CxCULraY.mjs → index-B9Ch8Jpe.mjs} +2 -2
- package/dist/_chunks/{index-34ICAF9_.mjs → index-Bj-erY7g.mjs} +4 -17
- package/dist/_chunks/{index-BFzW7Xex.js → index-CGxbhJfg.js} +4 -17
- package/dist/_chunks/{index-BZFGxKmY.mjs → index-DF3Edydl.mjs} +1 -1
- package/dist/_chunks/{index-B8urUtiz.mjs → index-Dufv-daf.mjs} +7 -36
- package/dist/_chunks/{index-M5s7QN5m.js → index-I72rBTkL.js} +1 -1
- package/dist/_chunks/{index-ivgYEX37.mjs → index-SCxv154G.mjs} +9 -128
- package/dist/_chunks/{index-CddEy_As.js → index-XYWLmmEs.js} +2 -2
- package/dist/_chunks/{index-CuXnqVl4.js → index-zzoovbM0.js} +9 -128
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/server/index.js +213 -754
- package/dist/server/index.mjs +213 -754
- package/package.json +3 -3
- package/dist/_chunks/LicenseGuard-5sMwgS6j.mjs +0 -646
- package/dist/_chunks/LicenseGuard-DqyOwTlf.js +0 -647
- package/dist/_chunks/LicensePage-2M-vOJX8.js +0 -377
- package/dist/_chunks/LicensePage-CCNW2hT6.mjs +0 -375
|
@@ -5,8 +5,8 @@ import { useIntl } from "react-intl";
|
|
|
5
5
|
import { Box, Typography, Flex, Button, Accordion, SingleSelect, SingleSelectOption, Grid, Switch, NumberInput, TextInput, Divider, Textarea, Badge } from "@strapi/design-system";
|
|
6
6
|
import { Check, Cog, Lightning, Shield, Mail, CheckCircle, Code, Link, Lock, Key } from "@strapi/icons";
|
|
7
7
|
import { useNotification, useFetchClient } from "@strapi/strapi/admin";
|
|
8
|
-
import { g as getTrad } from "./index-
|
|
9
|
-
import { u as usePluginLanguage, L as LicenseGuard, a as LanguageProvider } from "./LicenseGuard-
|
|
8
|
+
import { g as getTrad } from "./index-Bj-erY7g.mjs";
|
|
9
|
+
import { u as usePluginLanguage, L as LicenseGuard, a as LanguageProvider } from "./LicenseGuard-DJ5fq2UZ.mjs";
|
|
10
10
|
const EMAIL_TEMPLATES = {
|
|
11
11
|
modern: {
|
|
12
12
|
name: "Modern Gradient",
|
|
@@ -737,28 +737,18 @@ _Falls du diesen Link nicht angefordert hast, ignoriere diese Nachricht._`,
|
|
|
737
737
|
try {
|
|
738
738
|
const licenseRes = await get("/magic-link/license/status");
|
|
739
739
|
if (licenseRes?.data) {
|
|
740
|
-
|
|
741
|
-
const licenseData = licenseRes.data.data || licenseRes.data;
|
|
742
|
-
if (licenseData.features) {
|
|
743
|
-
if (licenseData.features.enterprise) {
|
|
744
|
-
tier = "enterprise";
|
|
745
|
-
} else if (licenseData.features.advanced) {
|
|
746
|
-
tier = "advanced";
|
|
747
|
-
} else if (licenseData.features.premium) {
|
|
748
|
-
tier = "premium";
|
|
749
|
-
}
|
|
750
|
-
}
|
|
740
|
+
const licenseData = licenseRes.data.data || {};
|
|
751
741
|
const enrichedLicenseInfo = {
|
|
752
742
|
...licenseData,
|
|
753
|
-
tier,
|
|
743
|
+
tier: "enterprise",
|
|
754
744
|
valid: licenseRes.data.valid !== false,
|
|
755
|
-
|
|
745
|
+
hasKey: licenseRes.data.hasKey === true
|
|
756
746
|
};
|
|
757
747
|
setLicenseInfo(enrichedLicenseInfo);
|
|
758
|
-
console.log("💎 License Info:", enrichedLicenseInfo);
|
|
759
748
|
}
|
|
760
749
|
} catch (error) {
|
|
761
750
|
console.error("Error loading license info:", error);
|
|
751
|
+
setLicenseInfo({ tier: "enterprise", valid: true, hasKey: false });
|
|
762
752
|
}
|
|
763
753
|
} catch (error) {
|
|
764
754
|
if (error.name !== "AbortError") {
|
|
@@ -817,27 +807,6 @@ _Falls du diesen Link nicht angefordert hast, ignoriere diese Nachricht._`,
|
|
|
817
807
|
setSelectedTemplateKey(templateEntry.value);
|
|
818
808
|
}
|
|
819
809
|
}, [settings.message_html, settings.message_text, selectedTemplateKey]);
|
|
820
|
-
useEffect(() => {
|
|
821
|
-
if (!licenseInfo) return;
|
|
822
|
-
const currentTier = licenseInfo.tier || "free";
|
|
823
|
-
let needsUpdate = false;
|
|
824
|
-
let newSettings = { ...settings };
|
|
825
|
-
if (settings.otp_enabled && !["premium", "advanced", "enterprise"].includes(currentTier)) {
|
|
826
|
-
newSettings.otp_enabled = false;
|
|
827
|
-
needsUpdate = true;
|
|
828
|
-
}
|
|
829
|
-
if (settings.mfa_require_totp && !["advanced", "enterprise"].includes(currentTier)) {
|
|
830
|
-
newSettings.mfa_require_totp = false;
|
|
831
|
-
needsUpdate = true;
|
|
832
|
-
}
|
|
833
|
-
if (settings.totp_as_primary_auth && !["advanced", "enterprise"].includes(currentTier)) {
|
|
834
|
-
newSettings.totp_as_primary_auth = false;
|
|
835
|
-
needsUpdate = true;
|
|
836
|
-
}
|
|
837
|
-
if (needsUpdate) {
|
|
838
|
-
setSettings(newSettings);
|
|
839
|
-
}
|
|
840
|
-
}, [licenseInfo, settings]);
|
|
841
810
|
const handleSave = async (e) => {
|
|
842
811
|
e.preventDefault();
|
|
843
812
|
setIsSaving(true);
|
|
@@ -869,31 +838,6 @@ _Falls du diesen Link nicht angefordert hast, ignoriere diese Nachricht._`,
|
|
|
869
838
|
const updateSetting = (key, value) => {
|
|
870
839
|
setSettings({ ...settings, [key]: value });
|
|
871
840
|
};
|
|
872
|
-
const checkLicenseAndSetMode = (mode) => {
|
|
873
|
-
const currentTier = licenseInfo?.tier || "free";
|
|
874
|
-
if (mode === "otp-email" && !["premium", "advanced", "enterprise"].includes(currentTier)) {
|
|
875
|
-
toggleNotification({
|
|
876
|
-
type: "warning",
|
|
877
|
-
message: "💎 Premium License Required: Email OTP requires at least Premium license. Please upgrade your license."
|
|
878
|
-
});
|
|
879
|
-
return false;
|
|
880
|
-
}
|
|
881
|
-
if (mode === "mfa-totp" && !["advanced", "enterprise"].includes(currentTier)) {
|
|
882
|
-
toggleNotification({
|
|
883
|
-
type: "warning",
|
|
884
|
-
message: "⚡ Advanced License Required: MFA with TOTP requires at least Advanced license. Please upgrade your license."
|
|
885
|
-
});
|
|
886
|
-
return false;
|
|
887
|
-
}
|
|
888
|
-
if (mode === "totp-primary" && !["advanced", "enterprise"].includes(currentTier)) {
|
|
889
|
-
toggleNotification({
|
|
890
|
-
type: "warning",
|
|
891
|
-
message: "⚡ Advanced License Required: TOTP-only login requires at least Advanced license. Please upgrade your license."
|
|
892
|
-
});
|
|
893
|
-
return false;
|
|
894
|
-
}
|
|
895
|
-
return true;
|
|
896
|
-
};
|
|
897
841
|
const handleLanguageChange = (newLang) => {
|
|
898
842
|
changeLanguage(newLang);
|
|
899
843
|
};
|
|
@@ -2233,21 +2177,9 @@ ${language === "de" ? "Der Link läuft in 1 Stunde ab." : "The link expires in 1
|
|
|
2233
2177
|
border: "2px solid rgba(128, 128, 128, 0.2)"
|
|
2234
2178
|
},
|
|
2235
2179
|
children: [
|
|
2236
|
-
/* @__PURE__ */ jsxs(Flex, {
|
|
2237
|
-
/* @__PURE__ */
|
|
2238
|
-
|
|
2239
|
-
/* @__PURE__ */ jsxs(Typography, { variant: "pi", fontWeight: "bold", style: { fontSize: "14px" }, children: [
|
|
2240
|
-
"Current License: ",
|
|
2241
|
-
licenseInfo?.tier ? licenseInfo.tier.charAt(0).toUpperCase() + licenseInfo.tier.slice(1) : "Free"
|
|
2242
|
-
] })
|
|
2243
|
-
] }),
|
|
2244
|
-
/* @__PURE__ */ jsx(Badge, { style: {
|
|
2245
|
-
backgroundColor: licenseInfo?.tier === "advanced" || licenseInfo?.tier === "enterprise" ? "#16A34A" : licenseInfo?.tier === "premium" ? "#7C3AED" : "#9CA3AF",
|
|
2246
|
-
color: "white",
|
|
2247
|
-
fontWeight: "600",
|
|
2248
|
-
fontSize: "11px",
|
|
2249
|
-
padding: "4px 12px"
|
|
2250
|
-
}, children: licenseInfo?.tier === "advanced" || licenseInfo?.tier === "enterprise" ? "✓ All Features Unlocked" : licenseInfo?.tier === "premium" ? "Email OTP Available" : "Basic Features Only" })
|
|
2180
|
+
/* @__PURE__ */ jsxs(Flex, { alignItems: "center", gap: 2, style: { marginBottom: "8px" }, children: [
|
|
2181
|
+
/* @__PURE__ */ jsx(Shield, { width: "20px", height: "20px", style: { color: "#16A34A" } }),
|
|
2182
|
+
/* @__PURE__ */ jsx(Typography, { variant: "pi", fontWeight: "bold", style: { fontSize: "14px" }, children: "All authentication modes are available" })
|
|
2251
2183
|
] }),
|
|
2252
2184
|
/* @__PURE__ */ jsxs(Typography, { variant: "pi", textColor: "neutral600", style: { fontSize: "12px", lineHeight: "1.5" }, children: [
|
|
2253
2185
|
"💡 ",
|
|
@@ -2332,7 +2264,6 @@ ${language === "de" ? "Der Link läuft in 1 Stunde ab." : "The link expires in 1
|
|
|
2332
2264
|
$active: settings.otp_enabled && !settings.mfa_require_totp && ["premium", "advanced", "enterprise"].includes(licenseInfo?.tier),
|
|
2333
2265
|
$statusLabel: settings.otp_enabled && !settings.mfa_require_totp && ["premium", "advanced", "enterprise"].includes(licenseInfo?.tier) ? "ACTIVE" : !["premium", "advanced", "enterprise"].includes(licenseInfo?.tier) ? "🔒 LOCKED" : "OFF",
|
|
2334
2266
|
onClick: () => {
|
|
2335
|
-
if (!checkLicenseAndSetMode("otp-email")) return;
|
|
2336
2267
|
updateSetting("otp_enabled", true);
|
|
2337
2268
|
updateSetting("mfa_require_totp", false);
|
|
2338
2269
|
updateSetting("totp_as_primary_auth", false);
|
|
@@ -2348,28 +2279,6 @@ ${language === "de" ? "Der Link läuft in 1 Stunde ab." : "The link expires in 1
|
|
|
2348
2279
|
position: "relative"
|
|
2349
2280
|
},
|
|
2350
2281
|
children: [
|
|
2351
|
-
!["premium", "advanced", "enterprise"].includes(licenseInfo?.tier) && /* @__PURE__ */ jsxs(
|
|
2352
|
-
"div",
|
|
2353
|
-
{
|
|
2354
|
-
style: {
|
|
2355
|
-
position: "absolute",
|
|
2356
|
-
top: 0,
|
|
2357
|
-
left: 0,
|
|
2358
|
-
right: 0,
|
|
2359
|
-
bottom: 0,
|
|
2360
|
-
display: "flex",
|
|
2361
|
-
alignItems: "center",
|
|
2362
|
-
justifyContent: "center",
|
|
2363
|
-
zIndex: 10,
|
|
2364
|
-
flexDirection: "column",
|
|
2365
|
-
gap: "8px"
|
|
2366
|
-
},
|
|
2367
|
-
children: [
|
|
2368
|
-
/* @__PURE__ */ jsx(Lock, { width: "40px", height: "40px", style: { color: "#7C3AED" } }),
|
|
2369
|
-
/* @__PURE__ */ jsx(Typography, { variant: "pi", fontWeight: "bold", style: { color: "#7C3AED", fontSize: "13px" }, children: "Premium Required" })
|
|
2370
|
-
]
|
|
2371
|
-
}
|
|
2372
|
-
),
|
|
2373
2282
|
/* @__PURE__ */ jsx(IconWrapper, { $bgColor: "rgba(124, 58, 237, 0.1)", $iconColor: "#7C3AED", children: /* @__PURE__ */ jsx(Mail, {}) }),
|
|
2374
2283
|
/* @__PURE__ */ jsxs(Box, { children: [
|
|
2375
2284
|
/* @__PURE__ */ jsx(Typography, { variant: "pi", fontWeight: "bold", style: { marginBottom: "8px", display: "block" }, children: "Magic Link + Email OTP" }),
|
|
@@ -2398,7 +2307,6 @@ ${language === "de" ? "Der Link läuft in 1 Stunde ab." : "The link expires in 1
|
|
|
2398
2307
|
startIcon: /* @__PURE__ */ jsx(Check, {}),
|
|
2399
2308
|
onClick: async (e) => {
|
|
2400
2309
|
e.stopPropagation();
|
|
2401
|
-
if (!checkLicenseAndSetMode("otp-email")) return;
|
|
2402
2310
|
try {
|
|
2403
2311
|
const newSettings = {
|
|
2404
2312
|
...settings,
|
|
@@ -2433,7 +2341,6 @@ ${language === "de" ? "Der Link läuft in 1 Stunde ab." : "The link expires in 1
|
|
|
2433
2341
|
$active: settings.mfa_require_totp && ["advanced", "enterprise"].includes(licenseInfo?.tier),
|
|
2434
2342
|
$statusLabel: settings.mfa_require_totp && ["advanced", "enterprise"].includes(licenseInfo?.tier) ? "ACTIVE" : !["advanced", "enterprise"].includes(licenseInfo?.tier) ? "🔒 LOCKED" : "OFF",
|
|
2435
2343
|
onClick: () => {
|
|
2436
|
-
if (!checkLicenseAndSetMode("mfa-totp")) return;
|
|
2437
2344
|
updateSetting("otp_enabled", false);
|
|
2438
2345
|
updateSetting("mfa_require_totp", true);
|
|
2439
2346
|
updateSetting("totp_as_primary_auth", false);
|
|
@@ -2449,28 +2356,6 @@ ${language === "de" ? "Der Link läuft in 1 Stunde ab." : "The link expires in 1
|
|
|
2449
2356
|
position: "relative"
|
|
2450
2357
|
},
|
|
2451
2358
|
children: [
|
|
2452
|
-
!["advanced", "enterprise"].includes(licenseInfo?.tier) && /* @__PURE__ */ jsxs(
|
|
2453
|
-
"div",
|
|
2454
|
-
{
|
|
2455
|
-
style: {
|
|
2456
|
-
position: "absolute",
|
|
2457
|
-
top: 0,
|
|
2458
|
-
left: 0,
|
|
2459
|
-
right: 0,
|
|
2460
|
-
bottom: 0,
|
|
2461
|
-
display: "flex",
|
|
2462
|
-
alignItems: "center",
|
|
2463
|
-
justifyContent: "center",
|
|
2464
|
-
zIndex: 10,
|
|
2465
|
-
flexDirection: "column",
|
|
2466
|
-
gap: "8px"
|
|
2467
|
-
},
|
|
2468
|
-
children: [
|
|
2469
|
-
/* @__PURE__ */ jsx(Lightning, { width: "40px", height: "40px", style: { color: "#D97706" } }),
|
|
2470
|
-
/* @__PURE__ */ jsx(Typography, { variant: "pi", fontWeight: "bold", style: { color: "#D97706", fontSize: "13px" }, children: "Advanced Required" })
|
|
2471
|
-
]
|
|
2472
|
-
}
|
|
2473
|
-
),
|
|
2474
2359
|
/* @__PURE__ */ jsx(IconWrapper, { $bgColor: "rgba(217, 119, 6, 0.1)", $iconColor: "#D97706", children: /* @__PURE__ */ jsx(Lock, {}) }),
|
|
2475
2360
|
/* @__PURE__ */ jsxs(Box, { children: [
|
|
2476
2361
|
/* @__PURE__ */ jsx(Typography, { variant: "pi", fontWeight: "bold", style: { marginBottom: "8px", display: "block" }, children: "Magic Link + TOTP (MFA)" }),
|
|
@@ -2499,7 +2384,6 @@ ${language === "de" ? "Der Link läuft in 1 Stunde ab." : "The link expires in 1
|
|
|
2499
2384
|
startIcon: /* @__PURE__ */ jsx(Check, {}),
|
|
2500
2385
|
onClick: async (e) => {
|
|
2501
2386
|
e.stopPropagation();
|
|
2502
|
-
if (!checkLicenseAndSetMode("mfa-totp")) return;
|
|
2503
2387
|
try {
|
|
2504
2388
|
const newSettings = {
|
|
2505
2389
|
...settings,
|
|
@@ -2679,9 +2563,6 @@ ${language === "de" ? "Der Link läuft in 1 Stunde ab." : "The link expires in 1
|
|
|
2679
2563
|
{
|
|
2680
2564
|
checked: settings.totp_as_primary_auth || false,
|
|
2681
2565
|
onCheckedChange: (checked) => {
|
|
2682
|
-
if (checked && !checkLicenseAndSetMode("totp-primary")) {
|
|
2683
|
-
return;
|
|
2684
|
-
}
|
|
2685
2566
|
updateSetting("totp_as_primary_auth", checked);
|
|
2686
2567
|
}
|
|
2687
2568
|
}
|
|
@@ -7,9 +7,9 @@ const styled = require("styled-components");
|
|
|
7
7
|
const reactIntl = require("react-intl");
|
|
8
8
|
const designSystem = require("@strapi/design-system");
|
|
9
9
|
const icons = require("@strapi/icons");
|
|
10
|
-
const index = require("./index-
|
|
10
|
+
const index = require("./index-CGxbhJfg.js");
|
|
11
11
|
const admin = require("@strapi/strapi/admin");
|
|
12
|
-
const LicenseGuard = require("./LicenseGuard-
|
|
12
|
+
const LicenseGuard = require("./LicenseGuard-CiyjFnrw.js");
|
|
13
13
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
14
14
|
const styled__default = /* @__PURE__ */ _interopDefault(styled);
|
|
15
15
|
const CreateTokenModal = ({ isOpen, onClose, onSubmit, formData, setFormData }) => {
|
|
@@ -7,8 +7,8 @@ const reactIntl = require("react-intl");
|
|
|
7
7
|
const designSystem = require("@strapi/design-system");
|
|
8
8
|
const icons = require("@strapi/icons");
|
|
9
9
|
const admin = require("@strapi/strapi/admin");
|
|
10
|
-
const index = require("./index-
|
|
11
|
-
const LicenseGuard = require("./LicenseGuard-
|
|
10
|
+
const index = require("./index-CGxbhJfg.js");
|
|
11
|
+
const LicenseGuard = require("./LicenseGuard-CiyjFnrw.js");
|
|
12
12
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
13
13
|
const styled__default = /* @__PURE__ */ _interopDefault(styled);
|
|
14
14
|
const EMAIL_TEMPLATES = {
|
|
@@ -741,28 +741,18 @@ _Falls du diesen Link nicht angefordert hast, ignoriere diese Nachricht._`,
|
|
|
741
741
|
try {
|
|
742
742
|
const licenseRes = await get("/magic-link/license/status");
|
|
743
743
|
if (licenseRes?.data) {
|
|
744
|
-
|
|
745
|
-
const licenseData = licenseRes.data.data || licenseRes.data;
|
|
746
|
-
if (licenseData.features) {
|
|
747
|
-
if (licenseData.features.enterprise) {
|
|
748
|
-
tier = "enterprise";
|
|
749
|
-
} else if (licenseData.features.advanced) {
|
|
750
|
-
tier = "advanced";
|
|
751
|
-
} else if (licenseData.features.premium) {
|
|
752
|
-
tier = "premium";
|
|
753
|
-
}
|
|
754
|
-
}
|
|
744
|
+
const licenseData = licenseRes.data.data || {};
|
|
755
745
|
const enrichedLicenseInfo = {
|
|
756
746
|
...licenseData,
|
|
757
|
-
tier,
|
|
747
|
+
tier: "enterprise",
|
|
758
748
|
valid: licenseRes.data.valid !== false,
|
|
759
|
-
|
|
749
|
+
hasKey: licenseRes.data.hasKey === true
|
|
760
750
|
};
|
|
761
751
|
setLicenseInfo(enrichedLicenseInfo);
|
|
762
|
-
console.log("💎 License Info:", enrichedLicenseInfo);
|
|
763
752
|
}
|
|
764
753
|
} catch (error) {
|
|
765
754
|
console.error("Error loading license info:", error);
|
|
755
|
+
setLicenseInfo({ tier: "enterprise", valid: true, hasKey: false });
|
|
766
756
|
}
|
|
767
757
|
} catch (error) {
|
|
768
758
|
if (error.name !== "AbortError") {
|
|
@@ -821,27 +811,6 @@ _Falls du diesen Link nicht angefordert hast, ignoriere diese Nachricht._`,
|
|
|
821
811
|
setSelectedTemplateKey(templateEntry.value);
|
|
822
812
|
}
|
|
823
813
|
}, [settings.message_html, settings.message_text, selectedTemplateKey]);
|
|
824
|
-
react.useEffect(() => {
|
|
825
|
-
if (!licenseInfo) return;
|
|
826
|
-
const currentTier = licenseInfo.tier || "free";
|
|
827
|
-
let needsUpdate = false;
|
|
828
|
-
let newSettings = { ...settings };
|
|
829
|
-
if (settings.otp_enabled && !["premium", "advanced", "enterprise"].includes(currentTier)) {
|
|
830
|
-
newSettings.otp_enabled = false;
|
|
831
|
-
needsUpdate = true;
|
|
832
|
-
}
|
|
833
|
-
if (settings.mfa_require_totp && !["advanced", "enterprise"].includes(currentTier)) {
|
|
834
|
-
newSettings.mfa_require_totp = false;
|
|
835
|
-
needsUpdate = true;
|
|
836
|
-
}
|
|
837
|
-
if (settings.totp_as_primary_auth && !["advanced", "enterprise"].includes(currentTier)) {
|
|
838
|
-
newSettings.totp_as_primary_auth = false;
|
|
839
|
-
needsUpdate = true;
|
|
840
|
-
}
|
|
841
|
-
if (needsUpdate) {
|
|
842
|
-
setSettings(newSettings);
|
|
843
|
-
}
|
|
844
|
-
}, [licenseInfo, settings]);
|
|
845
814
|
const handleSave = async (e) => {
|
|
846
815
|
e.preventDefault();
|
|
847
816
|
setIsSaving(true);
|
|
@@ -873,31 +842,6 @@ _Falls du diesen Link nicht angefordert hast, ignoriere diese Nachricht._`,
|
|
|
873
842
|
const updateSetting = (key, value) => {
|
|
874
843
|
setSettings({ ...settings, [key]: value });
|
|
875
844
|
};
|
|
876
|
-
const checkLicenseAndSetMode = (mode) => {
|
|
877
|
-
const currentTier = licenseInfo?.tier || "free";
|
|
878
|
-
if (mode === "otp-email" && !["premium", "advanced", "enterprise"].includes(currentTier)) {
|
|
879
|
-
toggleNotification({
|
|
880
|
-
type: "warning",
|
|
881
|
-
message: "💎 Premium License Required: Email OTP requires at least Premium license. Please upgrade your license."
|
|
882
|
-
});
|
|
883
|
-
return false;
|
|
884
|
-
}
|
|
885
|
-
if (mode === "mfa-totp" && !["advanced", "enterprise"].includes(currentTier)) {
|
|
886
|
-
toggleNotification({
|
|
887
|
-
type: "warning",
|
|
888
|
-
message: "⚡ Advanced License Required: MFA with TOTP requires at least Advanced license. Please upgrade your license."
|
|
889
|
-
});
|
|
890
|
-
return false;
|
|
891
|
-
}
|
|
892
|
-
if (mode === "totp-primary" && !["advanced", "enterprise"].includes(currentTier)) {
|
|
893
|
-
toggleNotification({
|
|
894
|
-
type: "warning",
|
|
895
|
-
message: "⚡ Advanced License Required: TOTP-only login requires at least Advanced license. Please upgrade your license."
|
|
896
|
-
});
|
|
897
|
-
return false;
|
|
898
|
-
}
|
|
899
|
-
return true;
|
|
900
|
-
};
|
|
901
845
|
const handleLanguageChange = (newLang) => {
|
|
902
846
|
changeLanguage(newLang);
|
|
903
847
|
};
|
|
@@ -2237,21 +2181,9 @@ ${language === "de" ? "Der Link läuft in 1 Stunde ab." : "The link expires in 1
|
|
|
2237
2181
|
border: "2px solid rgba(128, 128, 128, 0.2)"
|
|
2238
2182
|
},
|
|
2239
2183
|
children: [
|
|
2240
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, {
|
|
2241
|
-
/* @__PURE__ */ jsxRuntime.
|
|
2242
|
-
|
|
2243
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { fontSize: "14px" }, children: [
|
|
2244
|
-
"Current License: ",
|
|
2245
|
-
licenseInfo?.tier ? licenseInfo.tier.charAt(0).toUpperCase() + licenseInfo.tier.slice(1) : "Free"
|
|
2246
|
-
] })
|
|
2247
|
-
] }),
|
|
2248
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { style: {
|
|
2249
|
-
backgroundColor: licenseInfo?.tier === "advanced" || licenseInfo?.tier === "enterprise" ? "#16A34A" : licenseInfo?.tier === "premium" ? "#7C3AED" : "#9CA3AF",
|
|
2250
|
-
color: "white",
|
|
2251
|
-
fontWeight: "600",
|
|
2252
|
-
fontSize: "11px",
|
|
2253
|
-
padding: "4px 12px"
|
|
2254
|
-
}, children: licenseInfo?.tier === "advanced" || licenseInfo?.tier === "enterprise" ? "✓ All Features Unlocked" : licenseInfo?.tier === "premium" ? "Email OTP Available" : "Basic Features Only" })
|
|
2184
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { alignItems: "center", gap: 2, style: { marginBottom: "8px" }, children: [
|
|
2185
|
+
/* @__PURE__ */ jsxRuntime.jsx(icons.Shield, { width: "20px", height: "20px", style: { color: "#16A34A" } }),
|
|
2186
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { fontSize: "14px" }, children: "All authentication modes are available" })
|
|
2255
2187
|
] }),
|
|
2256
2188
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { variant: "pi", textColor: "neutral600", style: { fontSize: "12px", lineHeight: "1.5" }, children: [
|
|
2257
2189
|
"💡 ",
|
|
@@ -2336,7 +2268,6 @@ ${language === "de" ? "Der Link läuft in 1 Stunde ab." : "The link expires in 1
|
|
|
2336
2268
|
$active: settings.otp_enabled && !settings.mfa_require_totp && ["premium", "advanced", "enterprise"].includes(licenseInfo?.tier),
|
|
2337
2269
|
$statusLabel: settings.otp_enabled && !settings.mfa_require_totp && ["premium", "advanced", "enterprise"].includes(licenseInfo?.tier) ? "ACTIVE" : !["premium", "advanced", "enterprise"].includes(licenseInfo?.tier) ? "🔒 LOCKED" : "OFF",
|
|
2338
2270
|
onClick: () => {
|
|
2339
|
-
if (!checkLicenseAndSetMode("otp-email")) return;
|
|
2340
2271
|
updateSetting("otp_enabled", true);
|
|
2341
2272
|
updateSetting("mfa_require_totp", false);
|
|
2342
2273
|
updateSetting("totp_as_primary_auth", false);
|
|
@@ -2352,28 +2283,6 @@ ${language === "de" ? "Der Link läuft in 1 Stunde ab." : "The link expires in 1
|
|
|
2352
2283
|
position: "relative"
|
|
2353
2284
|
},
|
|
2354
2285
|
children: [
|
|
2355
|
-
!["premium", "advanced", "enterprise"].includes(licenseInfo?.tier) && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2356
|
-
"div",
|
|
2357
|
-
{
|
|
2358
|
-
style: {
|
|
2359
|
-
position: "absolute",
|
|
2360
|
-
top: 0,
|
|
2361
|
-
left: 0,
|
|
2362
|
-
right: 0,
|
|
2363
|
-
bottom: 0,
|
|
2364
|
-
display: "flex",
|
|
2365
|
-
alignItems: "center",
|
|
2366
|
-
justifyContent: "center",
|
|
2367
|
-
zIndex: 10,
|
|
2368
|
-
flexDirection: "column",
|
|
2369
|
-
gap: "8px"
|
|
2370
|
-
},
|
|
2371
|
-
children: [
|
|
2372
|
-
/* @__PURE__ */ jsxRuntime.jsx(icons.Lock, { width: "40px", height: "40px", style: { color: "#7C3AED" } }),
|
|
2373
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { color: "#7C3AED", fontSize: "13px" }, children: "Premium Required" })
|
|
2374
|
-
]
|
|
2375
|
-
}
|
|
2376
|
-
),
|
|
2377
2286
|
/* @__PURE__ */ jsxRuntime.jsx(IconWrapper, { $bgColor: "rgba(124, 58, 237, 0.1)", $iconColor: "#7C3AED", children: /* @__PURE__ */ jsxRuntime.jsx(icons.Mail, {}) }),
|
|
2378
2287
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
|
|
2379
2288
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { marginBottom: "8px", display: "block" }, children: "Magic Link + Email OTP" }),
|
|
@@ -2402,7 +2311,6 @@ ${language === "de" ? "Der Link läuft in 1 Stunde ab." : "The link expires in 1
|
|
|
2402
2311
|
startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.Check, {}),
|
|
2403
2312
|
onClick: async (e) => {
|
|
2404
2313
|
e.stopPropagation();
|
|
2405
|
-
if (!checkLicenseAndSetMode("otp-email")) return;
|
|
2406
2314
|
try {
|
|
2407
2315
|
const newSettings = {
|
|
2408
2316
|
...settings,
|
|
@@ -2437,7 +2345,6 @@ ${language === "de" ? "Der Link läuft in 1 Stunde ab." : "The link expires in 1
|
|
|
2437
2345
|
$active: settings.mfa_require_totp && ["advanced", "enterprise"].includes(licenseInfo?.tier),
|
|
2438
2346
|
$statusLabel: settings.mfa_require_totp && ["advanced", "enterprise"].includes(licenseInfo?.tier) ? "ACTIVE" : !["advanced", "enterprise"].includes(licenseInfo?.tier) ? "🔒 LOCKED" : "OFF",
|
|
2439
2347
|
onClick: () => {
|
|
2440
|
-
if (!checkLicenseAndSetMode("mfa-totp")) return;
|
|
2441
2348
|
updateSetting("otp_enabled", false);
|
|
2442
2349
|
updateSetting("mfa_require_totp", true);
|
|
2443
2350
|
updateSetting("totp_as_primary_auth", false);
|
|
@@ -2453,28 +2360,6 @@ ${language === "de" ? "Der Link läuft in 1 Stunde ab." : "The link expires in 1
|
|
|
2453
2360
|
position: "relative"
|
|
2454
2361
|
},
|
|
2455
2362
|
children: [
|
|
2456
|
-
!["advanced", "enterprise"].includes(licenseInfo?.tier) && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2457
|
-
"div",
|
|
2458
|
-
{
|
|
2459
|
-
style: {
|
|
2460
|
-
position: "absolute",
|
|
2461
|
-
top: 0,
|
|
2462
|
-
left: 0,
|
|
2463
|
-
right: 0,
|
|
2464
|
-
bottom: 0,
|
|
2465
|
-
display: "flex",
|
|
2466
|
-
alignItems: "center",
|
|
2467
|
-
justifyContent: "center",
|
|
2468
|
-
zIndex: 10,
|
|
2469
|
-
flexDirection: "column",
|
|
2470
|
-
gap: "8px"
|
|
2471
|
-
},
|
|
2472
|
-
children: [
|
|
2473
|
-
/* @__PURE__ */ jsxRuntime.jsx(icons.Lightning, { width: "40px", height: "40px", style: { color: "#D97706" } }),
|
|
2474
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { color: "#D97706", fontSize: "13px" }, children: "Advanced Required" })
|
|
2475
|
-
]
|
|
2476
|
-
}
|
|
2477
|
-
),
|
|
2478
2363
|
/* @__PURE__ */ jsxRuntime.jsx(IconWrapper, { $bgColor: "rgba(217, 119, 6, 0.1)", $iconColor: "#D97706", children: /* @__PURE__ */ jsxRuntime.jsx(icons.Lock, {}) }),
|
|
2479
2364
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
|
|
2480
2365
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { marginBottom: "8px", display: "block" }, children: "Magic Link + TOTP (MFA)" }),
|
|
@@ -2503,7 +2388,6 @@ ${language === "de" ? "Der Link läuft in 1 Stunde ab." : "The link expires in 1
|
|
|
2503
2388
|
startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.Check, {}),
|
|
2504
2389
|
onClick: async (e) => {
|
|
2505
2390
|
e.stopPropagation();
|
|
2506
|
-
if (!checkLicenseAndSetMode("mfa-totp")) return;
|
|
2507
2391
|
try {
|
|
2508
2392
|
const newSettings = {
|
|
2509
2393
|
...settings,
|
|
@@ -2683,9 +2567,6 @@ ${language === "de" ? "Der Link läuft in 1 Stunde ab." : "The link expires in 1
|
|
|
2683
2567
|
{
|
|
2684
2568
|
checked: settings.totp_as_primary_auth || false,
|
|
2685
2569
|
onCheckedChange: (checked) => {
|
|
2686
|
-
if (checked && !checkLicenseAndSetMode("totp-primary")) {
|
|
2687
|
-
return;
|
|
2688
|
-
}
|
|
2689
2570
|
updateSetting("totp_as_primary_auth", checked);
|
|
2690
2571
|
}
|
|
2691
2572
|
}
|
package/dist/admin/index.js
CHANGED
package/dist/admin/index.mjs
CHANGED