From c51150350a01e9e8dfa98f9bd899ca2eecc893fa Mon Sep 17 00:00:00 2001 From: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com> Date: Tue, 21 Feb 2023 14:30:08 +0530 Subject: [PATCH] chore: check IS_SELF_HOSTED in download (#7214) * chore: check IS_SELF_HOSTED in download Signed-off-by: Udit Takkar * Update apps/web/pages/api/download-cal-video-recording.ts Co-authored-by: Hariom Balhara * Update apps/web/pages/api/download-cal-video-recording.ts * Linting fix --------- Signed-off-by: Udit Takkar Co-authored-by: Hariom Balhara --- apps/web/pages/api/download-cal-video-recording.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/web/pages/api/download-cal-video-recording.ts b/apps/web/pages/api/download-cal-video-recording.ts index f912e4d1e9..7b692c9778 100644 --- a/apps/web/pages/api/download-cal-video-recording.ts +++ b/apps/web/pages/api/download-cal-video-recording.ts @@ -3,6 +3,7 @@ import { z } from "zod"; import { fetcher } from "@calcom/app-store/dailyvideo/lib/VideoApiAdapter"; import { getSession } from "@calcom/lib/auth"; +import { IS_SELF_HOSTED } from "@calcom/lib/constants"; import { defaultHandler, defaultResponder } from "@calcom/lib/server"; const getAccessLinkSchema = z.union([ @@ -25,7 +26,8 @@ async function handler( const session = await getSession({ req }); // Check if user belong to active team - if (!session?.user?.belongsToActiveTeam) { + const isDownloadAllowed = IS_SELF_HOSTED ? true : !session?.user?.belongsToActiveTeam; + if (!isDownloadAllowed) { return res.status(403); } try {