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.
This commit is contained in:
Mauricio Siu
2025-03-26 01:20:50 -06:00
parent 09d0435971
commit 439d2fe116

View File

@@ -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,