Refactor code structure for improved readability and maintainability
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user