strapi-plugin-magic-link-v5 5.5.4 → 5.5.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/CHANGELOG.md +14 -0
- package/dist/_chunks/{index-C6WRQuex.mjs → index-34ICAF9_.mjs} +3 -3
- package/dist/_chunks/{index-DoSROJog.js → index-BFzW7Xex.js} +3 -3
- package/dist/_chunks/{index-Ki-zhMlp.mjs → index-BZFGxKmY.mjs} +1 -1
- package/dist/_chunks/{index-DJyAppvB.js → index-CddEy_As.js} +1 -1
- package/dist/_chunks/{index-CQ3Kd12m.js → index-CuXnqVl4.js} +12 -10
- package/dist/_chunks/{index-B9M8wkAj.mjs → index-CxCULraY.mjs} +1 -1
- package/dist/_chunks/{index-DC00x-wm.js → index-M5s7QN5m.js} +1 -1
- package/dist/_chunks/{index-CoZjdlQd.mjs → index-ivgYEX37.mjs} +12 -10
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/server/index.js +414 -425
- package/dist/server/index.mjs +412 -423
- package/package.json +8 -2
package/dist/server/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import require$$0$3 from "crypto";
|
|
1
2
|
import require$$0$6 from "lodash";
|
|
2
3
|
import require$$1$2 from "nanoid";
|
|
3
|
-
import require$$0$
|
|
4
|
+
import require$$0$4 from "fs";
|
|
4
5
|
import require$$1 from "path";
|
|
5
|
-
import require$$0$4 from "crypto";
|
|
6
6
|
import require$$0$5 from "zod";
|
|
7
7
|
import require$$1$1 from "@strapi/utils";
|
|
8
8
|
import require$$1$3 from "os";
|
|
@@ -13,6 +13,143 @@ var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof win
|
|
|
13
13
|
function getDefaultExportFromCjs(x) {
|
|
14
14
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
15
15
|
}
|
|
16
|
+
const crypto$3 = require$$0$3;
|
|
17
|
+
let warnedMissingKey = false;
|
|
18
|
+
let warnedMissingPepper = false;
|
|
19
|
+
const isProduction = () => process.env.NODE_ENV === "production";
|
|
20
|
+
const devFallbackMaterial = () => process.env.ADMIN_JWT_SECRET || (Array.isArray(process.env.APP_KEYS) ? process.env.APP_KEYS[0] : process.env.APP_KEYS) || "magic-link-dev-fallback-DO-NOT-USE-IN-PRODUCTION";
|
|
21
|
+
const getEncryptionKey = () => {
|
|
22
|
+
const raw = process.env.MAGIC_LINK_ENCRYPTION_KEY;
|
|
23
|
+
if (raw && raw.length > 0) {
|
|
24
|
+
return crypto$3.createHash("sha256").update(raw).digest();
|
|
25
|
+
}
|
|
26
|
+
if (isProduction()) {
|
|
27
|
+
throw new Error(
|
|
28
|
+
`[magic-link] MAGIC_LINK_ENCRYPTION_KEY env var is required in production. Generate one with: node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"`
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
if (!warnedMissingKey) {
|
|
32
|
+
warnedMissingKey = true;
|
|
33
|
+
console.warn(
|
|
34
|
+
"[magic-link] MAGIC_LINK_ENCRYPTION_KEY not set — using dev fallback. Set this env var before going to production (it is NOT rotatable)."
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
return crypto$3.createHash("sha256").update(devFallbackMaterial()).digest();
|
|
38
|
+
};
|
|
39
|
+
const getOtpPepper = () => {
|
|
40
|
+
const raw = process.env.MAGIC_LINK_OTP_PEPPER || process.env.OTP_PEPPER;
|
|
41
|
+
if (raw && raw.length >= 16) {
|
|
42
|
+
return raw;
|
|
43
|
+
}
|
|
44
|
+
if (isProduction()) {
|
|
45
|
+
throw new Error(
|
|
46
|
+
`[magic-link] MAGIC_LINK_OTP_PEPPER env var is required in production (min 16 characters). Generate one with: node -e "console.log(require('crypto').randomBytes(24).toString('hex'))"`
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
if (!warnedMissingPepper) {
|
|
50
|
+
warnedMissingPepper = true;
|
|
51
|
+
console.warn(
|
|
52
|
+
"[magic-link] MAGIC_LINK_OTP_PEPPER not set — using dev fallback. Set this before deploying to production."
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
return "magic-link-otp-dev-pepper-DO-NOT-USE-IN-PRODUCTION";
|
|
56
|
+
};
|
|
57
|
+
const hash = (value) => {
|
|
58
|
+
if (!value) return null;
|
|
59
|
+
return crypto$3.createHash("sha256").update(String(value)).digest("hex");
|
|
60
|
+
};
|
|
61
|
+
const hashToken = (token2, salt = null) => {
|
|
62
|
+
if (!token2) return { hash: null, salt: null };
|
|
63
|
+
const tokenSalt = salt || crypto$3.randomBytes(16).toString("hex");
|
|
64
|
+
const hashedToken = crypto$3.createHash("sha256").update(token2 + tokenSalt).digest("hex");
|
|
65
|
+
return { hash: hashedToken, salt: tokenSalt };
|
|
66
|
+
};
|
|
67
|
+
const verifyToken = (token2, storedHash, salt) => {
|
|
68
|
+
if (!token2 || !storedHash) return false;
|
|
69
|
+
const { hash: computedHash } = hashToken(token2, salt);
|
|
70
|
+
return crypto$3.timingSafeEqual(
|
|
71
|
+
Buffer.from(computedHash, "hex"),
|
|
72
|
+
Buffer.from(storedHash, "hex")
|
|
73
|
+
);
|
|
74
|
+
};
|
|
75
|
+
const encrypt = (value) => {
|
|
76
|
+
if (!value) return null;
|
|
77
|
+
const key = getEncryptionKey();
|
|
78
|
+
const iv = crypto$3.randomBytes(16);
|
|
79
|
+
const cipher = crypto$3.createCipheriv("aes-256-gcm", key, iv);
|
|
80
|
+
let encrypted = cipher.update(String(value), "utf8", "hex");
|
|
81
|
+
encrypted += cipher.final("hex");
|
|
82
|
+
const authTag = cipher.getAuthTag();
|
|
83
|
+
return Buffer.from(
|
|
84
|
+
iv.toString("hex") + ":" + authTag.toString("hex") + ":" + encrypted
|
|
85
|
+
).toString("base64");
|
|
86
|
+
};
|
|
87
|
+
const decrypt = (encryptedValue) => {
|
|
88
|
+
if (!encryptedValue) return null;
|
|
89
|
+
const key = getEncryptionKey();
|
|
90
|
+
const data = Buffer.from(encryptedValue, "base64").toString("utf8");
|
|
91
|
+
const parts = data.split(":");
|
|
92
|
+
if (parts.length !== 3) {
|
|
93
|
+
throw new Error("[Crypto] decrypt: malformed ciphertext (expected iv:tag:ct)");
|
|
94
|
+
}
|
|
95
|
+
const [ivHex, authTagHex, encryptedHex] = parts;
|
|
96
|
+
if (!ivHex || !authTagHex || !encryptedHex) {
|
|
97
|
+
throw new Error("[Crypto] decrypt: missing ciphertext components");
|
|
98
|
+
}
|
|
99
|
+
const iv = Buffer.from(ivHex, "hex");
|
|
100
|
+
const authTag = Buffer.from(authTagHex, "hex");
|
|
101
|
+
const decipher = crypto$3.createDecipheriv("aes-256-gcm", key, iv);
|
|
102
|
+
decipher.setAuthTag(authTag);
|
|
103
|
+
let decrypted = decipher.update(encryptedHex, "hex", "utf8");
|
|
104
|
+
decrypted += decipher.final("utf8");
|
|
105
|
+
return decrypted;
|
|
106
|
+
};
|
|
107
|
+
const generateSecureRandom = (length = 32) => {
|
|
108
|
+
return crypto$3.randomBytes(Math.ceil(length / 2)).toString("hex").slice(0, length);
|
|
109
|
+
};
|
|
110
|
+
const hashOTP = (code) => {
|
|
111
|
+
if (!code) return null;
|
|
112
|
+
const pepper = getOtpPepper();
|
|
113
|
+
return crypto$3.createHash("sha256").update(code + pepper).digest("hex");
|
|
114
|
+
};
|
|
115
|
+
const verifyOTP = (code, storedHash) => {
|
|
116
|
+
if (!code || !storedHash) return false;
|
|
117
|
+
const computedHash = hashOTP(code);
|
|
118
|
+
try {
|
|
119
|
+
return crypto$3.timingSafeEqual(
|
|
120
|
+
Buffer.from(computedHash, "hex"),
|
|
121
|
+
Buffer.from(storedHash, "hex")
|
|
122
|
+
);
|
|
123
|
+
} catch {
|
|
124
|
+
return false;
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
const isEncrypted = (value) => {
|
|
128
|
+
if (!value) return false;
|
|
129
|
+
try {
|
|
130
|
+
const decoded = Buffer.from(value, "base64").toString("utf8");
|
|
131
|
+
const parts = decoded.split(":");
|
|
132
|
+
return parts.length === 3 && parts[0].length === 32 && parts[1].length === 32;
|
|
133
|
+
} catch {
|
|
134
|
+
return false;
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
const hashJwt = (jwt2) => {
|
|
138
|
+
if (!jwt2) return null;
|
|
139
|
+
return crypto$3.createHash("sha256").update(jwt2).digest("hex");
|
|
140
|
+
};
|
|
141
|
+
var crypto_1 = {
|
|
142
|
+
hash,
|
|
143
|
+
hashToken,
|
|
144
|
+
verifyToken,
|
|
145
|
+
encrypt,
|
|
146
|
+
decrypt,
|
|
147
|
+
generateSecureRandom,
|
|
148
|
+
hashOTP,
|
|
149
|
+
verifyOTP,
|
|
150
|
+
isEncrypted,
|
|
151
|
+
hashJwt
|
|
152
|
+
};
|
|
16
153
|
const magicLinkActions = {
|
|
17
154
|
actions: [
|
|
18
155
|
{
|
|
@@ -38,11 +175,11 @@ const magicLinkActions = {
|
|
|
38
175
|
}
|
|
39
176
|
]
|
|
40
177
|
};
|
|
178
|
+
const cryptoUtilsSelfTest = crypto_1;
|
|
41
179
|
var bootstrap$1 = async ({ strapi: strapi2 }) => {
|
|
42
180
|
try {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
cryptoUtils2.hashOTP("000000");
|
|
181
|
+
cryptoUtilsSelfTest.encrypt("self-test");
|
|
182
|
+
cryptoUtilsSelfTest.hashOTP("000000");
|
|
46
183
|
} catch (e) {
|
|
47
184
|
strapi2.log.error(`[magic-link] ${e.message}`);
|
|
48
185
|
throw e;
|
|
@@ -780,7 +917,7 @@ This link will expire in 1 hour.`,
|
|
|
780
917
|
}
|
|
781
918
|
}
|
|
782
919
|
};
|
|
783
|
-
const fs$1 = require$$0$
|
|
920
|
+
const fs$1 = require$$0$4;
|
|
784
921
|
const path$1 = require$$1;
|
|
785
922
|
class I18n {
|
|
786
923
|
constructor() {
|
|
@@ -922,143 +1059,6 @@ class I18n {
|
|
|
922
1059
|
}
|
|
923
1060
|
const i18n$1 = new I18n();
|
|
924
1061
|
var i18n_1 = i18n$1;
|
|
925
|
-
const crypto$3 = require$$0$4;
|
|
926
|
-
let warnedMissingKey = false;
|
|
927
|
-
let warnedMissingPepper = false;
|
|
928
|
-
const isProduction = () => process.env.NODE_ENV === "production";
|
|
929
|
-
const devFallbackMaterial = () => process.env.ADMIN_JWT_SECRET || (Array.isArray(process.env.APP_KEYS) ? process.env.APP_KEYS[0] : process.env.APP_KEYS) || "magic-link-dev-fallback-DO-NOT-USE-IN-PRODUCTION";
|
|
930
|
-
const getEncryptionKey = () => {
|
|
931
|
-
const raw = process.env.MAGIC_LINK_ENCRYPTION_KEY;
|
|
932
|
-
if (raw && raw.length > 0) {
|
|
933
|
-
return crypto$3.createHash("sha256").update(raw).digest();
|
|
934
|
-
}
|
|
935
|
-
if (isProduction()) {
|
|
936
|
-
throw new Error(
|
|
937
|
-
`[magic-link] MAGIC_LINK_ENCRYPTION_KEY env var is required in production. Generate one with: node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"`
|
|
938
|
-
);
|
|
939
|
-
}
|
|
940
|
-
if (!warnedMissingKey) {
|
|
941
|
-
warnedMissingKey = true;
|
|
942
|
-
console.warn(
|
|
943
|
-
"[magic-link] MAGIC_LINK_ENCRYPTION_KEY not set — using dev fallback. Set this env var before going to production (it is NOT rotatable)."
|
|
944
|
-
);
|
|
945
|
-
}
|
|
946
|
-
return crypto$3.createHash("sha256").update(devFallbackMaterial()).digest();
|
|
947
|
-
};
|
|
948
|
-
const getOtpPepper = () => {
|
|
949
|
-
const raw = process.env.MAGIC_LINK_OTP_PEPPER || process.env.OTP_PEPPER;
|
|
950
|
-
if (raw && raw.length >= 16) {
|
|
951
|
-
return raw;
|
|
952
|
-
}
|
|
953
|
-
if (isProduction()) {
|
|
954
|
-
throw new Error(
|
|
955
|
-
`[magic-link] MAGIC_LINK_OTP_PEPPER env var is required in production (min 16 characters). Generate one with: node -e "console.log(require('crypto').randomBytes(24).toString('hex'))"`
|
|
956
|
-
);
|
|
957
|
-
}
|
|
958
|
-
if (!warnedMissingPepper) {
|
|
959
|
-
warnedMissingPepper = true;
|
|
960
|
-
console.warn(
|
|
961
|
-
"[magic-link] MAGIC_LINK_OTP_PEPPER not set — using dev fallback. Set this before deploying to production."
|
|
962
|
-
);
|
|
963
|
-
}
|
|
964
|
-
return "magic-link-otp-dev-pepper-DO-NOT-USE-IN-PRODUCTION";
|
|
965
|
-
};
|
|
966
|
-
const hash = (value) => {
|
|
967
|
-
if (!value) return null;
|
|
968
|
-
return crypto$3.createHash("sha256").update(String(value)).digest("hex");
|
|
969
|
-
};
|
|
970
|
-
const hashToken = (token2, salt = null) => {
|
|
971
|
-
if (!token2) return { hash: null, salt: null };
|
|
972
|
-
const tokenSalt = salt || crypto$3.randomBytes(16).toString("hex");
|
|
973
|
-
const hashedToken = crypto$3.createHash("sha256").update(token2 + tokenSalt).digest("hex");
|
|
974
|
-
return { hash: hashedToken, salt: tokenSalt };
|
|
975
|
-
};
|
|
976
|
-
const verifyToken = (token2, storedHash, salt) => {
|
|
977
|
-
if (!token2 || !storedHash) return false;
|
|
978
|
-
const { hash: computedHash } = hashToken(token2, salt);
|
|
979
|
-
return crypto$3.timingSafeEqual(
|
|
980
|
-
Buffer.from(computedHash, "hex"),
|
|
981
|
-
Buffer.from(storedHash, "hex")
|
|
982
|
-
);
|
|
983
|
-
};
|
|
984
|
-
const encrypt = (value) => {
|
|
985
|
-
if (!value) return null;
|
|
986
|
-
const key = getEncryptionKey();
|
|
987
|
-
const iv = crypto$3.randomBytes(16);
|
|
988
|
-
const cipher = crypto$3.createCipheriv("aes-256-gcm", key, iv);
|
|
989
|
-
let encrypted = cipher.update(String(value), "utf8", "hex");
|
|
990
|
-
encrypted += cipher.final("hex");
|
|
991
|
-
const authTag = cipher.getAuthTag();
|
|
992
|
-
return Buffer.from(
|
|
993
|
-
iv.toString("hex") + ":" + authTag.toString("hex") + ":" + encrypted
|
|
994
|
-
).toString("base64");
|
|
995
|
-
};
|
|
996
|
-
const decrypt = (encryptedValue) => {
|
|
997
|
-
if (!encryptedValue) return null;
|
|
998
|
-
const key = getEncryptionKey();
|
|
999
|
-
const data = Buffer.from(encryptedValue, "base64").toString("utf8");
|
|
1000
|
-
const parts = data.split(":");
|
|
1001
|
-
if (parts.length !== 3) {
|
|
1002
|
-
throw new Error("[Crypto] decrypt: malformed ciphertext (expected iv:tag:ct)");
|
|
1003
|
-
}
|
|
1004
|
-
const [ivHex, authTagHex, encryptedHex] = parts;
|
|
1005
|
-
if (!ivHex || !authTagHex || !encryptedHex) {
|
|
1006
|
-
throw new Error("[Crypto] decrypt: missing ciphertext components");
|
|
1007
|
-
}
|
|
1008
|
-
const iv = Buffer.from(ivHex, "hex");
|
|
1009
|
-
const authTag = Buffer.from(authTagHex, "hex");
|
|
1010
|
-
const decipher = crypto$3.createDecipheriv("aes-256-gcm", key, iv);
|
|
1011
|
-
decipher.setAuthTag(authTag);
|
|
1012
|
-
let decrypted = decipher.update(encryptedHex, "hex", "utf8");
|
|
1013
|
-
decrypted += decipher.final("utf8");
|
|
1014
|
-
return decrypted;
|
|
1015
|
-
};
|
|
1016
|
-
const generateSecureRandom = (length = 32) => {
|
|
1017
|
-
return crypto$3.randomBytes(Math.ceil(length / 2)).toString("hex").slice(0, length);
|
|
1018
|
-
};
|
|
1019
|
-
const hashOTP = (code) => {
|
|
1020
|
-
if (!code) return null;
|
|
1021
|
-
const pepper = getOtpPepper();
|
|
1022
|
-
return crypto$3.createHash("sha256").update(code + pepper).digest("hex");
|
|
1023
|
-
};
|
|
1024
|
-
const verifyOTP = (code, storedHash) => {
|
|
1025
|
-
if (!code || !storedHash) return false;
|
|
1026
|
-
const computedHash = hashOTP(code);
|
|
1027
|
-
try {
|
|
1028
|
-
return crypto$3.timingSafeEqual(
|
|
1029
|
-
Buffer.from(computedHash, "hex"),
|
|
1030
|
-
Buffer.from(storedHash, "hex")
|
|
1031
|
-
);
|
|
1032
|
-
} catch {
|
|
1033
|
-
return false;
|
|
1034
|
-
}
|
|
1035
|
-
};
|
|
1036
|
-
const isEncrypted = (value) => {
|
|
1037
|
-
if (!value) return false;
|
|
1038
|
-
try {
|
|
1039
|
-
const decoded = Buffer.from(value, "base64").toString("utf8");
|
|
1040
|
-
const parts = decoded.split(":");
|
|
1041
|
-
return parts.length === 3 && parts[0].length === 32 && parts[1].length === 32;
|
|
1042
|
-
} catch {
|
|
1043
|
-
return false;
|
|
1044
|
-
}
|
|
1045
|
-
};
|
|
1046
|
-
const hashJwt = (jwt2) => {
|
|
1047
|
-
if (!jwt2) return null;
|
|
1048
|
-
return crypto$3.createHash("sha256").update(jwt2).digest("hex");
|
|
1049
|
-
};
|
|
1050
|
-
var crypto_1 = {
|
|
1051
|
-
hash,
|
|
1052
|
-
hashToken,
|
|
1053
|
-
verifyToken,
|
|
1054
|
-
encrypt,
|
|
1055
|
-
decrypt,
|
|
1056
|
-
generateSecureRandom,
|
|
1057
|
-
hashOTP,
|
|
1058
|
-
verifyOTP,
|
|
1059
|
-
isEncrypted,
|
|
1060
|
-
hashJwt
|
|
1061
|
-
};
|
|
1062
1062
|
const normalizeEmail$2 = (raw) => {
|
|
1063
1063
|
if (typeof raw !== "string") return null;
|
|
1064
1064
|
const trimmed = raw.trim();
|
|
@@ -1955,7 +1955,7 @@ var emailHelpers$3 = {
|
|
|
1955
1955
|
validateEmailConfig
|
|
1956
1956
|
};
|
|
1957
1957
|
const { nanoid: nanoid$1 } = require$$1$2;
|
|
1958
|
-
const crypto$2 = require$$0$
|
|
1958
|
+
const crypto$2 = require$$0$3;
|
|
1959
1959
|
const emailHelpers$2 = emailHelpers$3;
|
|
1960
1960
|
const cryptoUtils$3 = crypto_1;
|
|
1961
1961
|
const formatExpiryText$1 = (minutes) => {
|
|
@@ -4810,271 +4810,265 @@ var store$1 = ({ strapi: strapi2 }) => ({
|
|
|
4810
4810
|
return pluginStore.set({ key: "settings", value: settings });
|
|
4811
4811
|
}
|
|
4812
4812
|
});
|
|
4813
|
-
var features$1
|
|
4814
|
-
|
|
4815
|
-
|
|
4816
|
-
|
|
4817
|
-
|
|
4818
|
-
|
|
4819
|
-
//
|
|
4820
|
-
|
|
4821
|
-
|
|
4822
|
-
|
|
4823
|
-
|
|
4824
|
-
//
|
|
4825
|
-
|
|
4826
|
-
//
|
|
4827
|
-
|
|
4828
|
-
|
|
4829
|
-
|
|
4830
|
-
|
|
4831
|
-
|
|
4832
|
-
|
|
4833
|
-
|
|
4834
|
-
|
|
4835
|
-
|
|
4836
|
-
|
|
4837
|
-
|
|
4838
|
-
|
|
4839
|
-
|
|
4840
|
-
|
|
4841
|
-
|
|
4842
|
-
|
|
4843
|
-
|
|
4844
|
-
|
|
4845
|
-
|
|
4846
|
-
//
|
|
4847
|
-
|
|
4848
|
-
|
|
4849
|
-
|
|
4850
|
-
|
|
4851
|
-
|
|
4852
|
-
|
|
4853
|
-
|
|
4854
|
-
|
|
4855
|
-
|
|
4856
|
-
|
|
4857
|
-
|
|
4858
|
-
|
|
4859
|
-
|
|
4860
|
-
|
|
4861
|
-
|
|
4862
|
-
|
|
4863
|
-
|
|
4864
|
-
|
|
4865
|
-
|
|
4866
|
-
|
|
4867
|
-
|
|
4868
|
-
|
|
4869
|
-
|
|
4870
|
-
|
|
4871
|
-
|
|
4872
|
-
|
|
4873
|
-
|
|
4874
|
-
|
|
4875
|
-
|
|
4876
|
-
|
|
4877
|
-
|
|
4878
|
-
|
|
4879
|
-
|
|
4880
|
-
|
|
4881
|
-
|
|
4882
|
-
|
|
4883
|
-
|
|
4884
|
-
|
|
4885
|
-
//
|
|
4886
|
-
|
|
4887
|
-
|
|
4888
|
-
|
|
4889
|
-
|
|
4890
|
-
|
|
4891
|
-
|
|
4892
|
-
|
|
4893
|
-
|
|
4894
|
-
|
|
4895
|
-
|
|
4896
|
-
|
|
4897
|
-
|
|
4898
|
-
|
|
4899
|
-
|
|
4900
|
-
|
|
4901
|
-
|
|
4902
|
-
|
|
4903
|
-
|
|
4904
|
-
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
|
-
|
|
4908
|
-
|
|
4909
|
-
|
|
4910
|
-
|
|
4911
|
-
|
|
4912
|
-
|
|
4913
|
-
|
|
4914
|
-
|
|
4915
|
-
|
|
4916
|
-
|
|
4917
|
-
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
|
|
4921
|
-
|
|
4922
|
-
|
|
4923
|
-
|
|
4924
|
-
|
|
4925
|
-
|
|
4926
|
-
|
|
4927
|
-
|
|
4928
|
-
|
|
4929
|
-
|
|
4930
|
-
|
|
4931
|
-
|
|
4932
|
-
|
|
4933
|
-
|
|
4934
|
-
|
|
4935
|
-
|
|
4936
|
-
|
|
4937
|
-
|
|
4938
|
-
|
|
4939
|
-
|
|
4940
|
-
|
|
4941
|
-
|
|
4942
|
-
|
|
4943
|
-
|
|
4944
|
-
|
|
4945
|
-
|
|
4946
|
-
|
|
4947
|
-
|
|
4948
|
-
|
|
4949
|
-
|
|
4950
|
-
|
|
4951
|
-
|
|
4952
|
-
|
|
4953
|
-
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
|
|
4964
|
-
|
|
4965
|
-
|
|
4966
|
-
|
|
4967
|
-
|
|
4968
|
-
|
|
4969
|
-
|
|
4970
|
-
|
|
4971
|
-
|
|
4972
|
-
|
|
4973
|
-
|
|
4974
|
-
|
|
4975
|
-
|
|
4976
|
-
|
|
4977
|
-
|
|
4978
|
-
|
|
4979
|
-
|
|
4980
|
-
|
|
4981
|
-
|
|
4982
|
-
|
|
4983
|
-
|
|
4984
|
-
|
|
4985
|
-
|
|
4986
|
-
|
|
4987
|
-
|
|
4988
|
-
|
|
4989
|
-
|
|
4990
|
-
|
|
4991
|
-
|
|
4992
|
-
|
|
4993
|
-
/**
|
|
4994
|
-
* Check if a feature is available for given license tier
|
|
4995
|
-
*/
|
|
4996
|
-
hasFeature(licenseData, featureName) {
|
|
4997
|
-
if (!licenseData) {
|
|
4998
|
-
return this.free.features.includes(featureName);
|
|
4999
|
-
}
|
|
5000
|
-
let isEnterprise = false;
|
|
5001
|
-
let isAdvanced = false;
|
|
5002
|
-
let isPremium = false;
|
|
5003
|
-
if (licenseData.tier) {
|
|
5004
|
-
isEnterprise = licenseData.tier === "enterprise";
|
|
5005
|
-
isAdvanced = licenseData.tier === "advanced";
|
|
5006
|
-
isPremium = licenseData.tier === "premium";
|
|
5007
|
-
}
|
|
5008
|
-
if (licenseData.features) {
|
|
5009
|
-
isEnterprise = isEnterprise || licenseData.features.enterprise === true;
|
|
5010
|
-
isAdvanced = isAdvanced || licenseData.features.advanced === true;
|
|
5011
|
-
isPremium = isPremium || licenseData.features.premium === true;
|
|
5012
|
-
}
|
|
5013
|
-
if (licenseData.featureEnterprise === true) {
|
|
5014
|
-
isEnterprise = true;
|
|
5015
|
-
}
|
|
5016
|
-
if (licenseData.featureAdvanced === true) {
|
|
5017
|
-
isAdvanced = true;
|
|
5018
|
-
}
|
|
5019
|
-
if (licenseData.featurePremium === true) {
|
|
5020
|
-
isPremium = true;
|
|
5021
|
-
}
|
|
5022
|
-
if (isEnterprise && this.enterprise.features.includes(featureName)) {
|
|
5023
|
-
return true;
|
|
5024
|
-
}
|
|
5025
|
-
if (isAdvanced && this.advanced.features.includes(featureName)) {
|
|
5026
|
-
return true;
|
|
5027
|
-
}
|
|
5028
|
-
if (isPremium && this.premium.features.includes(featureName)) {
|
|
5029
|
-
return true;
|
|
5030
|
-
}
|
|
4813
|
+
var features$1 = {
|
|
4814
|
+
// FREE/DEMO Features
|
|
4815
|
+
free: {
|
|
4816
|
+
maxTokens: 100,
|
|
4817
|
+
// 100 aktive Tokens gleichzeitig
|
|
4818
|
+
maxSessions: 50,
|
|
4819
|
+
// 50 aktive JWT Sessions
|
|
4820
|
+
maxIPBans: 10,
|
|
4821
|
+
// 10 gebannte IPs
|
|
4822
|
+
features: [
|
|
4823
|
+
"basic-magic-link",
|
|
4824
|
+
// Basis Magic Link Auth
|
|
4825
|
+
"email-templates",
|
|
4826
|
+
// Basis Email Templates
|
|
4827
|
+
"jwt-sessions",
|
|
4828
|
+
// JWT Session Management
|
|
4829
|
+
"ip-tracking",
|
|
4830
|
+
// IP Tracking für Security
|
|
4831
|
+
"rate-limiting",
|
|
4832
|
+
// Basis Rate Limiting
|
|
4833
|
+
"auto-user-creation",
|
|
4834
|
+
// Auto User Creation
|
|
4835
|
+
"token-management",
|
|
4836
|
+
// Token Dashboard
|
|
4837
|
+
"ip-bans"
|
|
4838
|
+
// IP Ban Management
|
|
4839
|
+
]
|
|
4840
|
+
},
|
|
4841
|
+
// PREMIUM Features
|
|
4842
|
+
premium: {
|
|
4843
|
+
maxTokens: 1e3,
|
|
4844
|
+
// 1000 aktive Tokens
|
|
4845
|
+
maxSessions: 500,
|
|
4846
|
+
// 500 aktive Sessions
|
|
4847
|
+
maxIPBans: 100,
|
|
4848
|
+
// 100 gebannte IPs
|
|
4849
|
+
features: [
|
|
4850
|
+
"basic-magic-link",
|
|
4851
|
+
"email-templates",
|
|
4852
|
+
"jwt-sessions",
|
|
4853
|
+
"ip-tracking",
|
|
4854
|
+
"rate-limiting",
|
|
4855
|
+
"auto-user-creation",
|
|
4856
|
+
"token-management",
|
|
4857
|
+
"ip-bans",
|
|
4858
|
+
"otp-email",
|
|
4859
|
+
// Email OTP (6-digit code)
|
|
4860
|
+
"mfa-totp",
|
|
4861
|
+
// MFA: Magic Link + TOTP (Szenario 1)
|
|
4862
|
+
"custom-email-templates",
|
|
4863
|
+
// Custom HTML/Text Templates
|
|
4864
|
+
"email-designer-integration",
|
|
4865
|
+
// Email Designer 5 Support
|
|
4866
|
+
"magic-mail-integration",
|
|
4867
|
+
// MagicMail Integration
|
|
4868
|
+
"advanced-rate-limiting",
|
|
4869
|
+
// Custom Rate Limits
|
|
4870
|
+
"session-management",
|
|
4871
|
+
// Erweiterte Session Verwaltung
|
|
4872
|
+
"bulk-operations",
|
|
4873
|
+
// Bulk Token/Session Operations
|
|
4874
|
+
"extended-logging",
|
|
4875
|
+
// Erweiterte Login-Info Logs
|
|
4876
|
+
"custom-redirect-urls"
|
|
4877
|
+
// Custom Redirect URLs per Token
|
|
4878
|
+
]
|
|
4879
|
+
},
|
|
4880
|
+
// ADVANCED Features
|
|
4881
|
+
advanced: {
|
|
4882
|
+
maxTokens: -1,
|
|
4883
|
+
// Unlimited
|
|
4884
|
+
maxSessions: -1,
|
|
4885
|
+
// Unlimited
|
|
4886
|
+
maxIPBans: -1,
|
|
4887
|
+
// Unlimited
|
|
4888
|
+
features: [
|
|
4889
|
+
"basic-magic-link",
|
|
4890
|
+
"email-templates",
|
|
4891
|
+
"jwt-sessions",
|
|
4892
|
+
"ip-tracking",
|
|
4893
|
+
"rate-limiting",
|
|
4894
|
+
"auto-user-creation",
|
|
4895
|
+
"token-management",
|
|
4896
|
+
"ip-bans",
|
|
4897
|
+
"otp-email",
|
|
4898
|
+
"mfa-totp",
|
|
4899
|
+
// MFA: Magic Link + TOTP (Szenario 1)
|
|
4900
|
+
"otp-sms",
|
|
4901
|
+
// SMS OTP via Twilio/Vonage
|
|
4902
|
+
"otp-totp",
|
|
4903
|
+
// TOTP (Authenticator Apps)
|
|
4904
|
+
"totp-primary-login",
|
|
4905
|
+
// Login with Email + TOTP only (Szenario 2)
|
|
4906
|
+
"custom-email-templates",
|
|
4907
|
+
"email-designer-integration",
|
|
4908
|
+
"magic-mail-integration",
|
|
4909
|
+
"advanced-rate-limiting",
|
|
4910
|
+
"session-management",
|
|
4911
|
+
"bulk-operations",
|
|
4912
|
+
"extended-logging",
|
|
4913
|
+
"custom-redirect-urls",
|
|
4914
|
+
"webhook-notifications",
|
|
4915
|
+
// Webhooks für Events
|
|
4916
|
+
"api-access-tokens",
|
|
4917
|
+
// API Tokens für Programmatic Access
|
|
4918
|
+
"advanced-analytics",
|
|
4919
|
+
// Analytics Dashboard
|
|
4920
|
+
"custom-token-context",
|
|
4921
|
+
// Custom Context Data in Tokens
|
|
4922
|
+
"geolocation-tracking",
|
|
4923
|
+
// GeoIP Tracking
|
|
4924
|
+
"device-fingerprinting",
|
|
4925
|
+
// Device Fingerprinting
|
|
4926
|
+
"suspicious-login-alerts"
|
|
4927
|
+
// Alerts für verdächtige Logins
|
|
4928
|
+
]
|
|
4929
|
+
},
|
|
4930
|
+
// ENTERPRISE Features
|
|
4931
|
+
enterprise: {
|
|
4932
|
+
maxTokens: -1,
|
|
4933
|
+
maxSessions: -1,
|
|
4934
|
+
maxIPBans: -1,
|
|
4935
|
+
features: [
|
|
4936
|
+
"basic-magic-link",
|
|
4937
|
+
"email-templates",
|
|
4938
|
+
"jwt-sessions",
|
|
4939
|
+
"ip-tracking",
|
|
4940
|
+
"rate-limiting",
|
|
4941
|
+
"auto-user-creation",
|
|
4942
|
+
"token-management",
|
|
4943
|
+
"ip-bans",
|
|
4944
|
+
"otp-email",
|
|
4945
|
+
"mfa-totp",
|
|
4946
|
+
// MFA: Magic Link + TOTP (Szenario 1)
|
|
4947
|
+
"otp-sms",
|
|
4948
|
+
"otp-totp",
|
|
4949
|
+
"totp-primary-login",
|
|
4950
|
+
// Login with Email + TOTP only (Szenario 2)
|
|
4951
|
+
"otp-backup-codes",
|
|
4952
|
+
// Backup Recovery Codes
|
|
4953
|
+
"biometric-support",
|
|
4954
|
+
// WebAuthn/FIDO2
|
|
4955
|
+
"custom-email-templates",
|
|
4956
|
+
"email-designer-integration",
|
|
4957
|
+
"magic-mail-integration",
|
|
4958
|
+
"advanced-rate-limiting",
|
|
4959
|
+
"session-management",
|
|
4960
|
+
"bulk-operations",
|
|
4961
|
+
"extended-logging",
|
|
4962
|
+
"custom-redirect-urls",
|
|
4963
|
+
"webhook-notifications",
|
|
4964
|
+
"api-access-tokens",
|
|
4965
|
+
"advanced-analytics",
|
|
4966
|
+
"custom-token-context",
|
|
4967
|
+
"geolocation-tracking",
|
|
4968
|
+
"device-fingerprinting",
|
|
4969
|
+
"suspicious-login-alerts",
|
|
4970
|
+
"sso-integration",
|
|
4971
|
+
// SSO/SAML Integration
|
|
4972
|
+
"ldap-sync",
|
|
4973
|
+
// LDAP/AD Sync
|
|
4974
|
+
"audit-logs",
|
|
4975
|
+
// Vollständige Audit Logs
|
|
4976
|
+
"compliance-reports",
|
|
4977
|
+
// GDPR/SOC2 Reports
|
|
4978
|
+
"priority-support",
|
|
4979
|
+
// 24/7 Priority Support
|
|
4980
|
+
"custom-security-rules",
|
|
4981
|
+
// Custom Security Rules
|
|
4982
|
+
"multi-tenant",
|
|
4983
|
+
// Multi-Tenant Support
|
|
4984
|
+
"white-label"
|
|
4985
|
+
// White-Label Branding
|
|
4986
|
+
]
|
|
4987
|
+
},
|
|
4988
|
+
/**
|
|
4989
|
+
* Check if a feature is available for given license tier
|
|
4990
|
+
*/
|
|
4991
|
+
hasFeature(licenseData, featureName) {
|
|
4992
|
+
if (!licenseData) {
|
|
5031
4993
|
return this.free.features.includes(featureName);
|
|
5032
|
-
},
|
|
5033
|
-
/**
|
|
5034
|
-
* Get max allowed tokens for license tier
|
|
5035
|
-
*/
|
|
5036
|
-
getMaxTokens(licenseData) {
|
|
5037
|
-
if (!licenseData) return this.free.maxTokens;
|
|
5038
|
-
if (licenseData.featureEnterprise === true || licenseData.features?.enterprise === true) return this.enterprise.maxTokens;
|
|
5039
|
-
if (licenseData.featureAdvanced === true || licenseData.features?.advanced === true) return this.advanced.maxTokens;
|
|
5040
|
-
if (licenseData.featurePremium === true || licenseData.features?.premium === true) return this.premium.maxTokens;
|
|
5041
|
-
return this.free.maxTokens;
|
|
5042
|
-
},
|
|
5043
|
-
/**
|
|
5044
|
-
* Get max allowed sessions for license tier
|
|
5045
|
-
*/
|
|
5046
|
-
getMaxSessions(licenseData) {
|
|
5047
|
-
if (!licenseData) return this.free.maxSessions;
|
|
5048
|
-
if (licenseData.featureEnterprise === true || licenseData.features?.enterprise === true) return this.enterprise.maxSessions;
|
|
5049
|
-
if (licenseData.featureAdvanced === true || licenseData.features?.advanced === true) return this.advanced.maxSessions;
|
|
5050
|
-
if (licenseData.featurePremium === true || licenseData.features?.premium === true) return this.premium.maxSessions;
|
|
5051
|
-
return this.free.maxSessions;
|
|
5052
|
-
},
|
|
5053
|
-
/**
|
|
5054
|
-
* Get max allowed IP bans for license tier
|
|
5055
|
-
*/
|
|
5056
|
-
getMaxIPBans(licenseData) {
|
|
5057
|
-
if (!licenseData) return this.free.maxIPBans;
|
|
5058
|
-
if (licenseData.featureEnterprise === true || licenseData.features?.enterprise === true) return this.enterprise.maxIPBans;
|
|
5059
|
-
if (licenseData.featureAdvanced === true || licenseData.features?.advanced === true) return this.advanced.maxIPBans;
|
|
5060
|
-
if (licenseData.featurePremium === true || licenseData.features?.premium === true) return this.premium.maxIPBans;
|
|
5061
|
-
return this.free.maxIPBans;
|
|
5062
|
-
},
|
|
5063
|
-
/**
|
|
5064
|
-
* Get tier name from license data
|
|
5065
|
-
*/
|
|
5066
|
-
getTierName(licenseData) {
|
|
5067
|
-
if (!licenseData) return "free";
|
|
5068
|
-
if (licenseData.featureEnterprise === true || licenseData.features?.enterprise === true) return "enterprise";
|
|
5069
|
-
if (licenseData.featureAdvanced === true || licenseData.features?.advanced === true) return "advanced";
|
|
5070
|
-
if (licenseData.featurePremium === true || licenseData.features?.premium === true) return "premium";
|
|
5071
|
-
return "free";
|
|
5072
4994
|
}
|
|
5073
|
-
|
|
5074
|
-
|
|
5075
|
-
|
|
5076
|
-
|
|
4995
|
+
let isEnterprise = false;
|
|
4996
|
+
let isAdvanced = false;
|
|
4997
|
+
let isPremium = false;
|
|
4998
|
+
if (licenseData.tier) {
|
|
4999
|
+
isEnterprise = licenseData.tier === "enterprise";
|
|
5000
|
+
isAdvanced = licenseData.tier === "advanced";
|
|
5001
|
+
isPremium = licenseData.tier === "premium";
|
|
5002
|
+
}
|
|
5003
|
+
if (licenseData.features) {
|
|
5004
|
+
isEnterprise = isEnterprise || licenseData.features.enterprise === true;
|
|
5005
|
+
isAdvanced = isAdvanced || licenseData.features.advanced === true;
|
|
5006
|
+
isPremium = isPremium || licenseData.features.premium === true;
|
|
5007
|
+
}
|
|
5008
|
+
if (licenseData.featureEnterprise === true) {
|
|
5009
|
+
isEnterprise = true;
|
|
5010
|
+
}
|
|
5011
|
+
if (licenseData.featureAdvanced === true) {
|
|
5012
|
+
isAdvanced = true;
|
|
5013
|
+
}
|
|
5014
|
+
if (licenseData.featurePremium === true) {
|
|
5015
|
+
isPremium = true;
|
|
5016
|
+
}
|
|
5017
|
+
if (isEnterprise && this.enterprise.features.includes(featureName)) {
|
|
5018
|
+
return true;
|
|
5019
|
+
}
|
|
5020
|
+
if (isAdvanced && this.advanced.features.includes(featureName)) {
|
|
5021
|
+
return true;
|
|
5022
|
+
}
|
|
5023
|
+
if (isPremium && this.premium.features.includes(featureName)) {
|
|
5024
|
+
return true;
|
|
5025
|
+
}
|
|
5026
|
+
return this.free.features.includes(featureName);
|
|
5027
|
+
},
|
|
5028
|
+
/**
|
|
5029
|
+
* Get max allowed tokens for license tier
|
|
5030
|
+
*/
|
|
5031
|
+
getMaxTokens(licenseData) {
|
|
5032
|
+
if (!licenseData) return this.free.maxTokens;
|
|
5033
|
+
if (licenseData.featureEnterprise === true || licenseData.features?.enterprise === true) return this.enterprise.maxTokens;
|
|
5034
|
+
if (licenseData.featureAdvanced === true || licenseData.features?.advanced === true) return this.advanced.maxTokens;
|
|
5035
|
+
if (licenseData.featurePremium === true || licenseData.features?.premium === true) return this.premium.maxTokens;
|
|
5036
|
+
return this.free.maxTokens;
|
|
5037
|
+
},
|
|
5038
|
+
/**
|
|
5039
|
+
* Get max allowed sessions for license tier
|
|
5040
|
+
*/
|
|
5041
|
+
getMaxSessions(licenseData) {
|
|
5042
|
+
if (!licenseData) return this.free.maxSessions;
|
|
5043
|
+
if (licenseData.featureEnterprise === true || licenseData.features?.enterprise === true) return this.enterprise.maxSessions;
|
|
5044
|
+
if (licenseData.featureAdvanced === true || licenseData.features?.advanced === true) return this.advanced.maxSessions;
|
|
5045
|
+
if (licenseData.featurePremium === true || licenseData.features?.premium === true) return this.premium.maxSessions;
|
|
5046
|
+
return this.free.maxSessions;
|
|
5047
|
+
},
|
|
5048
|
+
/**
|
|
5049
|
+
* Get max allowed IP bans for license tier
|
|
5050
|
+
*/
|
|
5051
|
+
getMaxIPBans(licenseData) {
|
|
5052
|
+
if (!licenseData) return this.free.maxIPBans;
|
|
5053
|
+
if (licenseData.featureEnterprise === true || licenseData.features?.enterprise === true) return this.enterprise.maxIPBans;
|
|
5054
|
+
if (licenseData.featureAdvanced === true || licenseData.features?.advanced === true) return this.advanced.maxIPBans;
|
|
5055
|
+
if (licenseData.featurePremium === true || licenseData.features?.premium === true) return this.premium.maxIPBans;
|
|
5056
|
+
return this.free.maxIPBans;
|
|
5057
|
+
},
|
|
5058
|
+
/**
|
|
5059
|
+
* Get tier name from license data
|
|
5060
|
+
*/
|
|
5061
|
+
getTierName(licenseData) {
|
|
5062
|
+
if (!licenseData) return "free";
|
|
5063
|
+
if (licenseData.featureEnterprise === true || licenseData.features?.enterprise === true) return "enterprise";
|
|
5064
|
+
if (licenseData.featureAdvanced === true || licenseData.features?.advanced === true) return "advanced";
|
|
5065
|
+
if (licenseData.featurePremium === true || licenseData.features?.premium === true) return "premium";
|
|
5066
|
+
return "free";
|
|
5067
|
+
}
|
|
5068
|
+
};
|
|
5069
|
+
const crypto$1 = require$$0$3;
|
|
5077
5070
|
const os = require$$1$3;
|
|
5071
|
+
const features = features$1;
|
|
5078
5072
|
const LICENSE_SERVER_URL = "https://magicapi.fitlex.me";
|
|
5079
5073
|
const envTimeout = Number(process.env.MAGIC_LICENSE_TIMEOUT_MS);
|
|
5080
5074
|
const DEFAULT_FETCH_TIMEOUT_MS = Number.isFinite(envTimeout) && envTimeout > 0 ? envTimeout : 12e3;
|
|
@@ -5456,14 +5450,13 @@ var licenseGuard$1 = ({ strapi: strapi2 }) => ({
|
|
|
5456
5450
|
*/
|
|
5457
5451
|
async hasFeature(featureName) {
|
|
5458
5452
|
try {
|
|
5459
|
-
const features2 = requireFeatures();
|
|
5460
5453
|
const pluginStore = strapi2.store({ type: "plugin", name: "magic-link" });
|
|
5461
5454
|
const licenseKey = await pluginStore.get({ key: "licenseKey" });
|
|
5462
5455
|
if (!licenseKey) {
|
|
5463
|
-
return
|
|
5456
|
+
return features.hasFeature(null, featureName);
|
|
5464
5457
|
}
|
|
5465
5458
|
const licenseData = await this.getLicenseByKey(licenseKey);
|
|
5466
|
-
return
|
|
5459
|
+
return features.hasFeature(licenseData, featureName);
|
|
5467
5460
|
} catch (error) {
|
|
5468
5461
|
strapi2.log.error("Error checking feature:", error);
|
|
5469
5462
|
return false;
|
|
@@ -5475,14 +5468,13 @@ var licenseGuard$1 = ({ strapi: strapi2 }) => ({
|
|
|
5475
5468
|
*/
|
|
5476
5469
|
async getMaxTokens() {
|
|
5477
5470
|
try {
|
|
5478
|
-
const features2 = requireFeatures();
|
|
5479
5471
|
const pluginStore = strapi2.store({ type: "plugin", name: "magic-link" });
|
|
5480
5472
|
const licenseKey = await pluginStore.get({ key: "licenseKey" });
|
|
5481
5473
|
if (!licenseKey) {
|
|
5482
|
-
return
|
|
5474
|
+
return features.getMaxTokens(null);
|
|
5483
5475
|
}
|
|
5484
5476
|
const licenseData = await this.getLicenseByKey(licenseKey);
|
|
5485
|
-
return
|
|
5477
|
+
return features.getMaxTokens(licenseData);
|
|
5486
5478
|
} catch (error) {
|
|
5487
5479
|
strapi2.log.error("Error getting max tokens:", error);
|
|
5488
5480
|
return features.free.maxTokens;
|
|
@@ -5494,14 +5486,13 @@ var licenseGuard$1 = ({ strapi: strapi2 }) => ({
|
|
|
5494
5486
|
*/
|
|
5495
5487
|
async getMaxSessions() {
|
|
5496
5488
|
try {
|
|
5497
|
-
const features2 = requireFeatures();
|
|
5498
5489
|
const pluginStore = strapi2.store({ type: "plugin", name: "magic-link" });
|
|
5499
5490
|
const licenseKey = await pluginStore.get({ key: "licenseKey" });
|
|
5500
5491
|
if (!licenseKey) {
|
|
5501
|
-
return
|
|
5492
|
+
return features.getMaxSessions(null);
|
|
5502
5493
|
}
|
|
5503
5494
|
const licenseData = await this.getLicenseByKey(licenseKey);
|
|
5504
|
-
return
|
|
5495
|
+
return features.getMaxSessions(licenseData);
|
|
5505
5496
|
} catch (error) {
|
|
5506
5497
|
strapi2.log.error("Error getting max sessions:", error);
|
|
5507
5498
|
return features.free.maxSessions;
|
|
@@ -5513,14 +5504,13 @@ var licenseGuard$1 = ({ strapi: strapi2 }) => ({
|
|
|
5513
5504
|
*/
|
|
5514
5505
|
async getMaxIPBans() {
|
|
5515
5506
|
try {
|
|
5516
|
-
const features2 = requireFeatures();
|
|
5517
5507
|
const pluginStore = strapi2.store({ type: "plugin", name: "magic-link" });
|
|
5518
5508
|
const licenseKey = await pluginStore.get({ key: "licenseKey" });
|
|
5519
5509
|
if (!licenseKey) {
|
|
5520
|
-
return
|
|
5510
|
+
return features.getMaxIPBans(null);
|
|
5521
5511
|
}
|
|
5522
5512
|
const licenseData = await this.getLicenseByKey(licenseKey);
|
|
5523
|
-
return
|
|
5513
|
+
return features.getMaxIPBans(licenseData);
|
|
5524
5514
|
} catch (error) {
|
|
5525
5515
|
strapi2.log.error("Error getting max IP bans:", error);
|
|
5526
5516
|
return features.free.maxIPBans;
|
|
@@ -5532,14 +5522,13 @@ var licenseGuard$1 = ({ strapi: strapi2 }) => ({
|
|
|
5532
5522
|
*/
|
|
5533
5523
|
async getAvailableOTPTypes() {
|
|
5534
5524
|
try {
|
|
5535
|
-
const features2 = requireFeatures();
|
|
5536
5525
|
const pluginStore = strapi2.store({ type: "plugin", name: "magic-link" });
|
|
5537
5526
|
const licenseKey = await pluginStore.get({ key: "licenseKey" });
|
|
5538
5527
|
if (!licenseKey) {
|
|
5539
|
-
return
|
|
5528
|
+
return features.getAvailableOTPTypes(null);
|
|
5540
5529
|
}
|
|
5541
5530
|
const licenseData = await this.getLicenseByKey(licenseKey);
|
|
5542
|
-
return
|
|
5531
|
+
return features.getAvailableOTPTypes(licenseData);
|
|
5543
5532
|
} catch (error) {
|
|
5544
5533
|
strapi2.log.error("Error getting available OTP types:", error);
|
|
5545
5534
|
return [];
|
|
@@ -5710,7 +5699,7 @@ var rateLimiter$1 = ({ strapi: strapi2 }) => {
|
|
|
5710
5699
|
}
|
|
5711
5700
|
};
|
|
5712
5701
|
};
|
|
5713
|
-
const crypto = require$$0$
|
|
5702
|
+
const crypto = require$$0$3;
|
|
5714
5703
|
const speakeasy = require$$1$4;
|
|
5715
5704
|
const QRCode = require$$2;
|
|
5716
5705
|
const emailHelpers = emailHelpers$3;
|
|
@@ -6354,7 +6343,7 @@ If you didn't request this code, you can safely ignore this email.
|
|
|
6354
6343
|
};
|
|
6355
6344
|
};
|
|
6356
6345
|
const path = require$$1;
|
|
6357
|
-
const fs = require$$0$
|
|
6346
|
+
const fs = require$$0$4;
|
|
6358
6347
|
let baileys = null;
|
|
6359
6348
|
const getMagicMailWhatsApp = (strapi2) => {
|
|
6360
6349
|
try {
|