Refactor code structure for improved readability and maintainability

This commit is contained in:
2026-02-01 03:51:00 +00:00
parent 4292c62ad1
commit 15aecb3795
4 changed files with 35 additions and 23 deletions

View File

@@ -390,7 +390,10 @@ app.post("/api/licenses/verify", async (req, res) => {
const result = await touchLicenseHostname(license, hostname, { pluginVersion });
if (!result.ok) {
const status = result.conflict ? 403 : 400;
return res.status(status).json({ valid: false, error: result.error, boundHostname: license.primary_hostname });
const payload = await buildLicensePayload(license);
return res
.status(status)
.json({ valid: false, error: result.error, boundHostname: license.primary_hostname, license: payload });
}
const freshLicense = await getLicenseById(license.id);