From 439d2fe116597fcc67bda0c308435577becde31e Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Wed, 26 Mar 2025 01:20:50 -0600 Subject: [PATCH] feat(licenses): enhance license validation to check for existing server IPs - Added a condition in the validateLicense function to return success if the server IP is already included in the license's server IPs, improving the validation logic. --- apps/licenses/src/utils/license.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/licenses/src/utils/license.ts b/apps/licenses/src/utils/license.ts index b92efbe56..7d4bd740a 100644 --- a/apps/licenses/src/utils/license.ts +++ b/apps/licenses/src/utils/license.ts @@ -78,6 +78,13 @@ export const validateLicense = async (licenseKey: string, serverIp: string) => { const currentServerQuantity = license.serverIps?.length || 0; const serversQuantity = suscription.items.data[0].quantity || 0; + if (license.serverIps?.includes(serverIp)) { + return { + success: true, + license, + }; + } + if (currentServerQuantity >= serversQuantity) { return { success: false,