fix: Enable Salesforce & CRMs for teams & orgs [CAL-2116] (#9973)

Co-authored-by: Leo Giovanetti <hello@leog.me>
This commit is contained in:
Joe Au-Yeung
2023-07-11 13:11:21 +05:30
committed by GitHub
co-authored by Leo Giovanetti
parent 6e15de31aa
commit 267422a1f4
8 changed files with 87 additions and 7 deletions
+3
View File
@@ -3,6 +3,7 @@ import type { NextApiRequest, NextApiResponse } from "next";
import { WEBAPP_URL } from "@calcom/lib/constants";
import { encodeOAuthState } from "../../_utils/encodeOAuthState";
import getAppKeysFromSlug from "../../_utils/getAppKeysFromSlug";
import appConfig from "../config.json";
@@ -14,6 +15,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
if (!clientId) return res.status(400).json({ message: "Zoho Bigin client_id missing." });
const redirectUri = WEBAPP_URL + `/api/integrations/${appConfig.slug}/callback`;
const authUrl = axios.getUri({
url: "https://accounts.zoho.com/oauth/v2/auth",
params: {
@@ -22,6 +24,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
response_type: "code",
redirect_uri: redirectUri,
access_type: "offline",
state: encodeOAuthState(req),
},
});