mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
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:
@@ -78,6 +78,13 @@ export const validateLicense = async (licenseKey: string, serverIp: string) => {
|
|||||||
const currentServerQuantity = license.serverIps?.length || 0;
|
const currentServerQuantity = license.serverIps?.length || 0;
|
||||||
const serversQuantity = suscription.items.data[0].quantity || 0;
|
const serversQuantity = suscription.items.data[0].quantity || 0;
|
||||||
|
|
||||||
|
if (license.serverIps?.includes(serverIp)) {
|
||||||
|
return {
|
||||||
|
success: true,
|
||||||
|
license,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
if (currentServerQuantity >= serversQuantity) {
|
if (currentServerQuantity >= serversQuantity) {
|
||||||
return {
|
return {
|
||||||
success: false,
|
success: false,
|
||||||
|
|||||||
Reference in New Issue
Block a user