Files

18 lines
648 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.requireFeature = requireFeature;
function requireFeature(licenseService, feature) {
return (_req, res, next) => {
if (!licenseService.hasFeature(feature)) {
res.status(403).json({
error: 'Feature not available',
feature,
plan: licenseService.getCurrentLicense().plan.toString(),
message: `This feature requires a higher license plan. Current plan: ${licenseService.getCurrentLicense().plan.toString()}`,
});
return;
}
next();
};
}