strapi-plugin-magic-link-v5 5.5.5 → 5.5.7

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.
@@ -4641,6 +4641,50 @@ var magicLink$1 = ({ strapi: strapi2 }) => ({
4641
4641
  strapi2.log.error("MagicMail send failed, falling back to default provider:", error);
4642
4642
  }
4643
4643
  }
4644
+ const wantsEmailDesigner = settings?.use_email_designer && settings?.email_designer_template_id;
4645
+ const hasEmailDesignerPlugin = Boolean(strapi2.plugin("email-designer-5"));
4646
+ if (wantsEmailDesigner && hasEmailDesignerPlugin) {
4647
+ const templateId = parseInt(settings.email_designer_template_id, 10);
4648
+ if (!Number.isNaN(templateId) && templateId > 0) {
4649
+ try {
4650
+ await strapi2.plugin("email-designer-5").service("email").sendTemplatedEmail(
4651
+ {
4652
+ to: token2.email,
4653
+ from: settings.from_email ? `${settings.from_name || "Magic Link"} <${settings.from_email}>` : void 0,
4654
+ replyTo: settings.response_email || void 0
4655
+ },
4656
+ {
4657
+ templateReferenceId: templateId,
4658
+ subject: settings.object || emailConfig.object
4659
+ },
4660
+ {
4661
+ ...templatePayload,
4662
+ user: { email: token2.email },
4663
+ magicLink: loginUrl,
4664
+ expiresAt: token2.expires_at ? new Date(token2.expires_at).toISOString() : void 0,
4665
+ expiryText: expiryTextForTemplate
4666
+ }
4667
+ );
4668
+ strapi2.log.info(
4669
+ `Magic Link email sent via Email Designer 5 (template ${templateId}) to ${token2.email}`
4670
+ );
4671
+ return token2;
4672
+ } catch (emailDesignerError) {
4673
+ strapi2.log.error(
4674
+ "Email Designer 5 send failed, falling back to default provider:",
4675
+ emailDesignerError
4676
+ );
4677
+ }
4678
+ } else {
4679
+ strapi2.log.warn(
4680
+ `Invalid Email Designer template ID: '${settings.email_designer_template_id}', falling back to default email`
4681
+ );
4682
+ }
4683
+ } else if (wantsEmailDesigner && !hasEmailDesignerPlugin) {
4684
+ strapi2.log.debug(
4685
+ "Email Designer enabled but plugin not installed — falling back to default email"
4686
+ );
4687
+ }
4644
4688
  await strapi2.plugin("email").service("email").send({
4645
4689
  to: token2.email,
4646
4690
  from: emailConfig.from,
@@ -4823,271 +4867,265 @@ var store$1 = ({ strapi: strapi2 }) => ({
4823
4867
  return pluginStore.set({ key: "settings", value: settings });
4824
4868
  }
4825
4869
  });
4826
- var features$1;
4827
- var hasRequiredFeatures;
4828
- function requireFeatures() {
4829
- if (hasRequiredFeatures) return features$1;
4830
- hasRequiredFeatures = 1;
4831
- features$1 = {
4832
- // FREE/DEMO Features
4833
- free: {
4834
- maxTokens: 100,
4835
- // 100 aktive Tokens gleichzeitig
4836
- maxSessions: 50,
4837
- // 50 aktive JWT Sessions
4838
- maxIPBans: 10,
4839
- // 10 gebannte IPs
4840
- features: [
4841
- "basic-magic-link",
4842
- // Basis Magic Link Auth
4843
- "email-templates",
4844
- // Basis Email Templates
4845
- "jwt-sessions",
4846
- // JWT Session Management
4847
- "ip-tracking",
4848
- // IP Tracking für Security
4849
- "rate-limiting",
4850
- // Basis Rate Limiting
4851
- "auto-user-creation",
4852
- // Auto User Creation
4853
- "token-management",
4854
- // Token Dashboard
4855
- "ip-bans"
4856
- // IP Ban Management
4857
- ]
4858
- },
4859
- // PREMIUM Features
4860
- premium: {
4861
- maxTokens: 1e3,
4862
- // 1000 aktive Tokens
4863
- maxSessions: 500,
4864
- // 500 aktive Sessions
4865
- maxIPBans: 100,
4866
- // 100 gebannte IPs
4867
- features: [
4868
- "basic-magic-link",
4869
- "email-templates",
4870
- "jwt-sessions",
4871
- "ip-tracking",
4872
- "rate-limiting",
4873
- "auto-user-creation",
4874
- "token-management",
4875
- "ip-bans",
4876
- "otp-email",
4877
- // Email OTP (6-digit code)
4878
- "mfa-totp",
4879
- // MFA: Magic Link + TOTP (Szenario 1)
4880
- "custom-email-templates",
4881
- // Custom HTML/Text Templates
4882
- "email-designer-integration",
4883
- // Email Designer 5 Support
4884
- "magic-mail-integration",
4885
- // MagicMail Integration
4886
- "advanced-rate-limiting",
4887
- // Custom Rate Limits
4888
- "session-management",
4889
- // Erweiterte Session Verwaltung
4890
- "bulk-operations",
4891
- // Bulk Token/Session Operations
4892
- "extended-logging",
4893
- // Erweiterte Login-Info Logs
4894
- "custom-redirect-urls"
4895
- // Custom Redirect URLs per Token
4896
- ]
4897
- },
4898
- // ADVANCED Features
4899
- advanced: {
4900
- maxTokens: -1,
4901
- // Unlimited
4902
- maxSessions: -1,
4903
- // Unlimited
4904
- maxIPBans: -1,
4905
- // Unlimited
4906
- features: [
4907
- "basic-magic-link",
4908
- "email-templates",
4909
- "jwt-sessions",
4910
- "ip-tracking",
4911
- "rate-limiting",
4912
- "auto-user-creation",
4913
- "token-management",
4914
- "ip-bans",
4915
- "otp-email",
4916
- "mfa-totp",
4917
- // MFA: Magic Link + TOTP (Szenario 1)
4918
- "otp-sms",
4919
- // SMS OTP via Twilio/Vonage
4920
- "otp-totp",
4921
- // TOTP (Authenticator Apps)
4922
- "totp-primary-login",
4923
- // Login with Email + TOTP only (Szenario 2)
4924
- "custom-email-templates",
4925
- "email-designer-integration",
4926
- "magic-mail-integration",
4927
- "advanced-rate-limiting",
4928
- "session-management",
4929
- "bulk-operations",
4930
- "extended-logging",
4931
- "custom-redirect-urls",
4932
- "webhook-notifications",
4933
- // Webhooks für Events
4934
- "api-access-tokens",
4935
- // API Tokens für Programmatic Access
4936
- "advanced-analytics",
4937
- // Analytics Dashboard
4938
- "custom-token-context",
4939
- // Custom Context Data in Tokens
4940
- "geolocation-tracking",
4941
- // GeoIP Tracking
4942
- "device-fingerprinting",
4943
- // Device Fingerprinting
4944
- "suspicious-login-alerts"
4945
- // Alerts für verdächtige Logins
4946
- ]
4947
- },
4948
- // ENTERPRISE Features
4949
- enterprise: {
4950
- maxTokens: -1,
4951
- maxSessions: -1,
4952
- maxIPBans: -1,
4953
- features: [
4954
- "basic-magic-link",
4955
- "email-templates",
4956
- "jwt-sessions",
4957
- "ip-tracking",
4958
- "rate-limiting",
4959
- "auto-user-creation",
4960
- "token-management",
4961
- "ip-bans",
4962
- "otp-email",
4963
- "mfa-totp",
4964
- // MFA: Magic Link + TOTP (Szenario 1)
4965
- "otp-sms",
4966
- "otp-totp",
4967
- "totp-primary-login",
4968
- // Login with Email + TOTP only (Szenario 2)
4969
- "otp-backup-codes",
4970
- // Backup Recovery Codes
4971
- "biometric-support",
4972
- // WebAuthn/FIDO2
4973
- "custom-email-templates",
4974
- "email-designer-integration",
4975
- "magic-mail-integration",
4976
- "advanced-rate-limiting",
4977
- "session-management",
4978
- "bulk-operations",
4979
- "extended-logging",
4980
- "custom-redirect-urls",
4981
- "webhook-notifications",
4982
- "api-access-tokens",
4983
- "advanced-analytics",
4984
- "custom-token-context",
4985
- "geolocation-tracking",
4986
- "device-fingerprinting",
4987
- "suspicious-login-alerts",
4988
- "sso-integration",
4989
- // SSO/SAML Integration
4990
- "ldap-sync",
4991
- // LDAP/AD Sync
4992
- "audit-logs",
4993
- // Vollständige Audit Logs
4994
- "compliance-reports",
4995
- // GDPR/SOC2 Reports
4996
- "priority-support",
4997
- // 24/7 Priority Support
4998
- "custom-security-rules",
4999
- // Custom Security Rules
5000
- "multi-tenant",
5001
- // Multi-Tenant Support
5002
- "white-label"
5003
- // White-Label Branding
5004
- ]
5005
- },
5006
- /**
5007
- * Check if a feature is available for given license tier
5008
- */
5009
- hasFeature(licenseData, featureName) {
5010
- if (!licenseData) {
5011
- return this.free.features.includes(featureName);
5012
- }
5013
- let isEnterprise = false;
5014
- let isAdvanced = false;
5015
- let isPremium = false;
5016
- if (licenseData.tier) {
5017
- isEnterprise = licenseData.tier === "enterprise";
5018
- isAdvanced = licenseData.tier === "advanced";
5019
- isPremium = licenseData.tier === "premium";
5020
- }
5021
- if (licenseData.features) {
5022
- isEnterprise = isEnterprise || licenseData.features.enterprise === true;
5023
- isAdvanced = isAdvanced || licenseData.features.advanced === true;
5024
- isPremium = isPremium || licenseData.features.premium === true;
5025
- }
5026
- if (licenseData.featureEnterprise === true) {
5027
- isEnterprise = true;
5028
- }
5029
- if (licenseData.featureAdvanced === true) {
5030
- isAdvanced = true;
5031
- }
5032
- if (licenseData.featurePremium === true) {
5033
- isPremium = true;
5034
- }
5035
- if (isEnterprise && this.enterprise.features.includes(featureName)) {
5036
- return true;
5037
- }
5038
- if (isAdvanced && this.advanced.features.includes(featureName)) {
5039
- return true;
5040
- }
5041
- if (isPremium && this.premium.features.includes(featureName)) {
5042
- return true;
5043
- }
4870
+ var features$1 = {
4871
+ // FREE/DEMO Features
4872
+ free: {
4873
+ maxTokens: 100,
4874
+ // 100 aktive Tokens gleichzeitig
4875
+ maxSessions: 50,
4876
+ // 50 aktive JWT Sessions
4877
+ maxIPBans: 10,
4878
+ // 10 gebannte IPs
4879
+ features: [
4880
+ "basic-magic-link",
4881
+ // Basis Magic Link Auth
4882
+ "email-templates",
4883
+ // Basis Email Templates
4884
+ "jwt-sessions",
4885
+ // JWT Session Management
4886
+ "ip-tracking",
4887
+ // IP Tracking für Security
4888
+ "rate-limiting",
4889
+ // Basis Rate Limiting
4890
+ "auto-user-creation",
4891
+ // Auto User Creation
4892
+ "token-management",
4893
+ // Token Dashboard
4894
+ "ip-bans"
4895
+ // IP Ban Management
4896
+ ]
4897
+ },
4898
+ // PREMIUM Features
4899
+ premium: {
4900
+ maxTokens: 1e3,
4901
+ // 1000 aktive Tokens
4902
+ maxSessions: 500,
4903
+ // 500 aktive Sessions
4904
+ maxIPBans: 100,
4905
+ // 100 gebannte IPs
4906
+ features: [
4907
+ "basic-magic-link",
4908
+ "email-templates",
4909
+ "jwt-sessions",
4910
+ "ip-tracking",
4911
+ "rate-limiting",
4912
+ "auto-user-creation",
4913
+ "token-management",
4914
+ "ip-bans",
4915
+ "otp-email",
4916
+ // Email OTP (6-digit code)
4917
+ "mfa-totp",
4918
+ // MFA: Magic Link + TOTP (Szenario 1)
4919
+ "custom-email-templates",
4920
+ // Custom HTML/Text Templates
4921
+ "email-designer-integration",
4922
+ // Email Designer 5 Support
4923
+ "magic-mail-integration",
4924
+ // MagicMail Integration
4925
+ "advanced-rate-limiting",
4926
+ // Custom Rate Limits
4927
+ "session-management",
4928
+ // Erweiterte Session Verwaltung
4929
+ "bulk-operations",
4930
+ // Bulk Token/Session Operations
4931
+ "extended-logging",
4932
+ // Erweiterte Login-Info Logs
4933
+ "custom-redirect-urls"
4934
+ // Custom Redirect URLs per Token
4935
+ ]
4936
+ },
4937
+ // ADVANCED Features
4938
+ advanced: {
4939
+ maxTokens: -1,
4940
+ // Unlimited
4941
+ maxSessions: -1,
4942
+ // Unlimited
4943
+ maxIPBans: -1,
4944
+ // Unlimited
4945
+ features: [
4946
+ "basic-magic-link",
4947
+ "email-templates",
4948
+ "jwt-sessions",
4949
+ "ip-tracking",
4950
+ "rate-limiting",
4951
+ "auto-user-creation",
4952
+ "token-management",
4953
+ "ip-bans",
4954
+ "otp-email",
4955
+ "mfa-totp",
4956
+ // MFA: Magic Link + TOTP (Szenario 1)
4957
+ "otp-sms",
4958
+ // SMS OTP via Twilio/Vonage
4959
+ "otp-totp",
4960
+ // TOTP (Authenticator Apps)
4961
+ "totp-primary-login",
4962
+ // Login with Email + TOTP only (Szenario 2)
4963
+ "custom-email-templates",
4964
+ "email-designer-integration",
4965
+ "magic-mail-integration",
4966
+ "advanced-rate-limiting",
4967
+ "session-management",
4968
+ "bulk-operations",
4969
+ "extended-logging",
4970
+ "custom-redirect-urls",
4971
+ "webhook-notifications",
4972
+ // Webhooks für Events
4973
+ "api-access-tokens",
4974
+ // API Tokens für Programmatic Access
4975
+ "advanced-analytics",
4976
+ // Analytics Dashboard
4977
+ "custom-token-context",
4978
+ // Custom Context Data in Tokens
4979
+ "geolocation-tracking",
4980
+ // GeoIP Tracking
4981
+ "device-fingerprinting",
4982
+ // Device Fingerprinting
4983
+ "suspicious-login-alerts"
4984
+ // Alerts für verdächtige Logins
4985
+ ]
4986
+ },
4987
+ // ENTERPRISE Features
4988
+ enterprise: {
4989
+ maxTokens: -1,
4990
+ maxSessions: -1,
4991
+ maxIPBans: -1,
4992
+ features: [
4993
+ "basic-magic-link",
4994
+ "email-templates",
4995
+ "jwt-sessions",
4996
+ "ip-tracking",
4997
+ "rate-limiting",
4998
+ "auto-user-creation",
4999
+ "token-management",
5000
+ "ip-bans",
5001
+ "otp-email",
5002
+ "mfa-totp",
5003
+ // MFA: Magic Link + TOTP (Szenario 1)
5004
+ "otp-sms",
5005
+ "otp-totp",
5006
+ "totp-primary-login",
5007
+ // Login with Email + TOTP only (Szenario 2)
5008
+ "otp-backup-codes",
5009
+ // Backup Recovery Codes
5010
+ "biometric-support",
5011
+ // WebAuthn/FIDO2
5012
+ "custom-email-templates",
5013
+ "email-designer-integration",
5014
+ "magic-mail-integration",
5015
+ "advanced-rate-limiting",
5016
+ "session-management",
5017
+ "bulk-operations",
5018
+ "extended-logging",
5019
+ "custom-redirect-urls",
5020
+ "webhook-notifications",
5021
+ "api-access-tokens",
5022
+ "advanced-analytics",
5023
+ "custom-token-context",
5024
+ "geolocation-tracking",
5025
+ "device-fingerprinting",
5026
+ "suspicious-login-alerts",
5027
+ "sso-integration",
5028
+ // SSO/SAML Integration
5029
+ "ldap-sync",
5030
+ // LDAP/AD Sync
5031
+ "audit-logs",
5032
+ // Vollständige Audit Logs
5033
+ "compliance-reports",
5034
+ // GDPR/SOC2 Reports
5035
+ "priority-support",
5036
+ // 24/7 Priority Support
5037
+ "custom-security-rules",
5038
+ // Custom Security Rules
5039
+ "multi-tenant",
5040
+ // Multi-Tenant Support
5041
+ "white-label"
5042
+ // White-Label Branding
5043
+ ]
5044
+ },
5045
+ /**
5046
+ * Check if a feature is available for given license tier
5047
+ */
5048
+ hasFeature(licenseData, featureName) {
5049
+ if (!licenseData) {
5044
5050
  return this.free.features.includes(featureName);
5045
- },
5046
- /**
5047
- * Get max allowed tokens for license tier
5048
- */
5049
- getMaxTokens(licenseData) {
5050
- if (!licenseData) return this.free.maxTokens;
5051
- if (licenseData.featureEnterprise === true || licenseData.features?.enterprise === true) return this.enterprise.maxTokens;
5052
- if (licenseData.featureAdvanced === true || licenseData.features?.advanced === true) return this.advanced.maxTokens;
5053
- if (licenseData.featurePremium === true || licenseData.features?.premium === true) return this.premium.maxTokens;
5054
- return this.free.maxTokens;
5055
- },
5056
- /**
5057
- * Get max allowed sessions for license tier
5058
- */
5059
- getMaxSessions(licenseData) {
5060
- if (!licenseData) return this.free.maxSessions;
5061
- if (licenseData.featureEnterprise === true || licenseData.features?.enterprise === true) return this.enterprise.maxSessions;
5062
- if (licenseData.featureAdvanced === true || licenseData.features?.advanced === true) return this.advanced.maxSessions;
5063
- if (licenseData.featurePremium === true || licenseData.features?.premium === true) return this.premium.maxSessions;
5064
- return this.free.maxSessions;
5065
- },
5066
- /**
5067
- * Get max allowed IP bans for license tier
5068
- */
5069
- getMaxIPBans(licenseData) {
5070
- if (!licenseData) return this.free.maxIPBans;
5071
- if (licenseData.featureEnterprise === true || licenseData.features?.enterprise === true) return this.enterprise.maxIPBans;
5072
- if (licenseData.featureAdvanced === true || licenseData.features?.advanced === true) return this.advanced.maxIPBans;
5073
- if (licenseData.featurePremium === true || licenseData.features?.premium === true) return this.premium.maxIPBans;
5074
- return this.free.maxIPBans;
5075
- },
5076
- /**
5077
- * Get tier name from license data
5078
- */
5079
- getTierName(licenseData) {
5080
- if (!licenseData) return "free";
5081
- if (licenseData.featureEnterprise === true || licenseData.features?.enterprise === true) return "enterprise";
5082
- if (licenseData.featureAdvanced === true || licenseData.features?.advanced === true) return "advanced";
5083
- if (licenseData.featurePremium === true || licenseData.features?.premium === true) return "premium";
5084
- return "free";
5085
5051
  }
5086
- };
5087
- return features$1;
5088
- }
5052
+ let isEnterprise = false;
5053
+ let isAdvanced = false;
5054
+ let isPremium = false;
5055
+ if (licenseData.tier) {
5056
+ isEnterprise = licenseData.tier === "enterprise";
5057
+ isAdvanced = licenseData.tier === "advanced";
5058
+ isPremium = licenseData.tier === "premium";
5059
+ }
5060
+ if (licenseData.features) {
5061
+ isEnterprise = isEnterprise || licenseData.features.enterprise === true;
5062
+ isAdvanced = isAdvanced || licenseData.features.advanced === true;
5063
+ isPremium = isPremium || licenseData.features.premium === true;
5064
+ }
5065
+ if (licenseData.featureEnterprise === true) {
5066
+ isEnterprise = true;
5067
+ }
5068
+ if (licenseData.featureAdvanced === true) {
5069
+ isAdvanced = true;
5070
+ }
5071
+ if (licenseData.featurePremium === true) {
5072
+ isPremium = true;
5073
+ }
5074
+ if (isEnterprise && this.enterprise.features.includes(featureName)) {
5075
+ return true;
5076
+ }
5077
+ if (isAdvanced && this.advanced.features.includes(featureName)) {
5078
+ return true;
5079
+ }
5080
+ if (isPremium && this.premium.features.includes(featureName)) {
5081
+ return true;
5082
+ }
5083
+ return this.free.features.includes(featureName);
5084
+ },
5085
+ /**
5086
+ * Get max allowed tokens for license tier
5087
+ */
5088
+ getMaxTokens(licenseData) {
5089
+ if (!licenseData) return this.free.maxTokens;
5090
+ if (licenseData.featureEnterprise === true || licenseData.features?.enterprise === true) return this.enterprise.maxTokens;
5091
+ if (licenseData.featureAdvanced === true || licenseData.features?.advanced === true) return this.advanced.maxTokens;
5092
+ if (licenseData.featurePremium === true || licenseData.features?.premium === true) return this.premium.maxTokens;
5093
+ return this.free.maxTokens;
5094
+ },
5095
+ /**
5096
+ * Get max allowed sessions for license tier
5097
+ */
5098
+ getMaxSessions(licenseData) {
5099
+ if (!licenseData) return this.free.maxSessions;
5100
+ if (licenseData.featureEnterprise === true || licenseData.features?.enterprise === true) return this.enterprise.maxSessions;
5101
+ if (licenseData.featureAdvanced === true || licenseData.features?.advanced === true) return this.advanced.maxSessions;
5102
+ if (licenseData.featurePremium === true || licenseData.features?.premium === true) return this.premium.maxSessions;
5103
+ return this.free.maxSessions;
5104
+ },
5105
+ /**
5106
+ * Get max allowed IP bans for license tier
5107
+ */
5108
+ getMaxIPBans(licenseData) {
5109
+ if (!licenseData) return this.free.maxIPBans;
5110
+ if (licenseData.featureEnterprise === true || licenseData.features?.enterprise === true) return this.enterprise.maxIPBans;
5111
+ if (licenseData.featureAdvanced === true || licenseData.features?.advanced === true) return this.advanced.maxIPBans;
5112
+ if (licenseData.featurePremium === true || licenseData.features?.premium === true) return this.premium.maxIPBans;
5113
+ return this.free.maxIPBans;
5114
+ },
5115
+ /**
5116
+ * Get tier name from license data
5117
+ */
5118
+ getTierName(licenseData) {
5119
+ if (!licenseData) return "free";
5120
+ if (licenseData.featureEnterprise === true || licenseData.features?.enterprise === true) return "enterprise";
5121
+ if (licenseData.featureAdvanced === true || licenseData.features?.advanced === true) return "advanced";
5122
+ if (licenseData.featurePremium === true || licenseData.features?.premium === true) return "premium";
5123
+ return "free";
5124
+ }
5125
+ };
5089
5126
  const crypto$1 = require$$0__default.default;
5090
5127
  const os = require$$1__default$3.default;
5128
+ const features = features$1;
5091
5129
  const LICENSE_SERVER_URL = "https://magicapi.fitlex.me";
5092
5130
  const envTimeout = Number(process.env.MAGIC_LICENSE_TIMEOUT_MS);
5093
5131
  const DEFAULT_FETCH_TIMEOUT_MS = Number.isFinite(envTimeout) && envTimeout > 0 ? envTimeout : 12e3;
@@ -5469,14 +5507,13 @@ var licenseGuard$1 = ({ strapi: strapi2 }) => ({
5469
5507
  */
5470
5508
  async hasFeature(featureName) {
5471
5509
  try {
5472
- const features2 = requireFeatures();
5473
5510
  const pluginStore = strapi2.store({ type: "plugin", name: "magic-link" });
5474
5511
  const licenseKey = await pluginStore.get({ key: "licenseKey" });
5475
5512
  if (!licenseKey) {
5476
- return features2.hasFeature(null, featureName);
5513
+ return features.hasFeature(null, featureName);
5477
5514
  }
5478
5515
  const licenseData = await this.getLicenseByKey(licenseKey);
5479
- return features2.hasFeature(licenseData, featureName);
5516
+ return features.hasFeature(licenseData, featureName);
5480
5517
  } catch (error) {
5481
5518
  strapi2.log.error("Error checking feature:", error);
5482
5519
  return false;
@@ -5488,14 +5525,13 @@ var licenseGuard$1 = ({ strapi: strapi2 }) => ({
5488
5525
  */
5489
5526
  async getMaxTokens() {
5490
5527
  try {
5491
- const features2 = requireFeatures();
5492
5528
  const pluginStore = strapi2.store({ type: "plugin", name: "magic-link" });
5493
5529
  const licenseKey = await pluginStore.get({ key: "licenseKey" });
5494
5530
  if (!licenseKey) {
5495
- return features2.getMaxTokens(null);
5531
+ return features.getMaxTokens(null);
5496
5532
  }
5497
5533
  const licenseData = await this.getLicenseByKey(licenseKey);
5498
- return features2.getMaxTokens(licenseData);
5534
+ return features.getMaxTokens(licenseData);
5499
5535
  } catch (error) {
5500
5536
  strapi2.log.error("Error getting max tokens:", error);
5501
5537
  return features.free.maxTokens;
@@ -5507,14 +5543,13 @@ var licenseGuard$1 = ({ strapi: strapi2 }) => ({
5507
5543
  */
5508
5544
  async getMaxSessions() {
5509
5545
  try {
5510
- const features2 = requireFeatures();
5511
5546
  const pluginStore = strapi2.store({ type: "plugin", name: "magic-link" });
5512
5547
  const licenseKey = await pluginStore.get({ key: "licenseKey" });
5513
5548
  if (!licenseKey) {
5514
- return features2.getMaxSessions(null);
5549
+ return features.getMaxSessions(null);
5515
5550
  }
5516
5551
  const licenseData = await this.getLicenseByKey(licenseKey);
5517
- return features2.getMaxSessions(licenseData);
5552
+ return features.getMaxSessions(licenseData);
5518
5553
  } catch (error) {
5519
5554
  strapi2.log.error("Error getting max sessions:", error);
5520
5555
  return features.free.maxSessions;
@@ -5526,14 +5561,13 @@ var licenseGuard$1 = ({ strapi: strapi2 }) => ({
5526
5561
  */
5527
5562
  async getMaxIPBans() {
5528
5563
  try {
5529
- const features2 = requireFeatures();
5530
5564
  const pluginStore = strapi2.store({ type: "plugin", name: "magic-link" });
5531
5565
  const licenseKey = await pluginStore.get({ key: "licenseKey" });
5532
5566
  if (!licenseKey) {
5533
- return features2.getMaxIPBans(null);
5567
+ return features.getMaxIPBans(null);
5534
5568
  }
5535
5569
  const licenseData = await this.getLicenseByKey(licenseKey);
5536
- return features2.getMaxIPBans(licenseData);
5570
+ return features.getMaxIPBans(licenseData);
5537
5571
  } catch (error) {
5538
5572
  strapi2.log.error("Error getting max IP bans:", error);
5539
5573
  return features.free.maxIPBans;
@@ -5545,14 +5579,13 @@ var licenseGuard$1 = ({ strapi: strapi2 }) => ({
5545
5579
  */
5546
5580
  async getAvailableOTPTypes() {
5547
5581
  try {
5548
- const features2 = requireFeatures();
5549
5582
  const pluginStore = strapi2.store({ type: "plugin", name: "magic-link" });
5550
5583
  const licenseKey = await pluginStore.get({ key: "licenseKey" });
5551
5584
  if (!licenseKey) {
5552
- return features2.getAvailableOTPTypes(null);
5585
+ return features.getAvailableOTPTypes(null);
5553
5586
  }
5554
5587
  const licenseData = await this.getLicenseByKey(licenseKey);
5555
- return features2.getAvailableOTPTypes(licenseData);
5588
+ return features.getAvailableOTPTypes(licenseData);
5556
5589
  } catch (error) {
5557
5590
  strapi2.log.error("Error getting available OTP types:", error);
5558
5591
  return [];