chore: check IS_SELF_HOSTED in download (#7214)

* chore: check IS_SELF_HOSTED in download

Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>

* Update apps/web/pages/api/download-cal-video-recording.ts

Co-authored-by: Hariom Balhara <hariombalhara@gmail.com>

* Update apps/web/pages/api/download-cal-video-recording.ts

* Linting fix

---------

Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
Co-authored-by: Hariom Balhara <hariombalhara@gmail.com>
This commit is contained in:
Udit Takkar
2023-02-21 09:00:08 +00:00
committed by GitHub
co-authored by Hariom Balhara
parent 51664bf733
commit c51150350a
@@ -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 {