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