feat(licenses): enhance license validation process

- Updated the validateLicense function to accept server IP for improved validation.
- Modified user API to utilize the new validateLicense signature.
- Added useEffect in EnablePaidFeatures component to set license key based on user data.
- Improved error handling and user feedback during license validation.
This commit is contained in:
Mauricio Siu
2025-03-23 04:55:16 -06:00
parent fb0272a64d
commit b7874f053f
4 changed files with 38 additions and 8 deletions

View File

@@ -56,6 +56,8 @@ router.get("/health", async (c) => {
router.post("/validate", zValidator("json", validateSchema), async (c) => {
const { licenseKey, serverIp } = c.req.valid("json");
console.log("Validating license", licenseKey, serverIp);
try {
const result = await validateLicense(licenseKey, serverIp);
return c.json(result);