Skip to content

Commit aa5e90a

Browse files
Sparky-AutonomousSparky Autonomous
andauthored
chore: Bail earlier when an invalid session is found (Fixes calcom#15982) (calcom#27609)
Co-authored-by: Sparky Autonomous <sparky@openclaw.ai>
1 parent 321b07a commit aa5e90a

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

apps/web/pages/api/integrations/[...args].ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
5454
}
5555

5656
const [appName, apiEndpoint] = args;
57+
58+
if (apiEndpoint === "add" && !req.session?.user?.id) {
59+
return res.status(401).json({ message: "You must be logged in to do this" });
60+
}
61+
5762
try {
5863
/* Absolute path didn't work */
5964
const handlerMap = (await import("@calcom/app-store/apps.server.generated")).apiHandlers;

0 commit comments

Comments
 (0)