From aa5e90ab2a09a2fdd15d2f46f115c7dded01e739 Mon Sep 17 00:00:00 2001 From: Sparky_Autonomous Date: Sat, 7 Feb 2026 12:37:33 +0500 Subject: [PATCH] chore: Bail earlier when an invalid session is found (Fixes #15982) (#27609) Co-authored-by: Sparky Autonomous --- apps/web/pages/api/integrations/[...args].ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/web/pages/api/integrations/[...args].ts b/apps/web/pages/api/integrations/[...args].ts index b77c17252c..aed2608820 100644 --- a/apps/web/pages/api/integrations/[...args].ts +++ b/apps/web/pages/api/integrations/[...args].ts @@ -54,6 +54,11 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => { } const [appName, apiEndpoint] = args; + + if (apiEndpoint === "add" && !req.session?.user?.id) { + return res.status(401).json({ message: "You must be logged in to do this" }); + } + try { /* Absolute path didn't work */ const handlerMap = (await import("@calcom/app-store/apps.server.generated")).apiHandlers;