Scheduling infrastructure for absolutely everyone.
Updated checkLicense
zomars0b2724124acd
diff --git a/lib/helpers/verifyApiKey.ts b/lib/helpers/verifyApiKey.tsindex 3f8731c33c7..2420dc4358c 100644--- a/lib/helpers/verifyApiKey.ts+++ b/lib/helpers/verifyApiKey.ts@@ -15,10 +15,10 @@ export const dateNotInPast = function (date: Date) {// This verifies the apiKey and sets the user if it is valid.export const verifyApiKey: NextMiddleware = async (req, res, next) => {- const hasValidLicense = await checkLicense(process.env.CALCOM_LICENSE_KEY || "");+ const { prisma, isCustomPrisma, isAdmin } = req;+ const hasValidLicense = await checkLicense(prisma);if (!hasValidLicense)return res.status(401).json({ error: "Invalid or missing CALCOM_LICENSE_KEY environment variable" });- const { prisma, isCustomPrisma, isAdmin } = req;// If the user is an admin and using a license key (from customPrisma), skip the apiKey check.if (isCustomPrisma && isAdmin) {await next();