Populate msteams key in db (#2743)

* Populate msteams key in db

* Fix calendar credentials to teams

* Clarify account dialog

Co-authored-by: Omar López <zomars@me.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: Bailey Pumfleet <pumfleet@hey.com>
This commit is contained in:
Joe Au-Yeung
2022-05-13 14:20:50 +02:00
committed by GitHub
co-authored by Omar López kodiakhq[bot] Bailey Pumfleet
parent bf1f9b6a32
commit 498759890f
4 changed files with 8 additions and 5 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ let client_id = "";
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
if (req.method === "GET") {
const appKeys = await getAppKeysFromSlug("office365-calendar");
const appKeys = await getAppKeysFromSlug("msteams");
if (typeof appKeys.client_id === "string") client_id = appKeys.client_id;
if (!client_id) return res.status(400).json({ message: "Office 365 client_id missing." });
const state = encodeOAuthState(req);
@@ -21,7 +21,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
return;
}
const appKeys = await getAppKeysFromSlug("office365-calendar");
const appKeys = await getAppKeysFromSlug("msteams");
if (typeof appKeys.client_id === "string") client_id = appKeys.client_id;
if (typeof appKeys.client_secret === "string") client_secret = appKeys.client_secret;
if (!client_id) return res.status(400).json({ message: "Office 365 client_id missing." });
@@ -11,12 +11,12 @@ import {
import useAddAppMutation from "../../_utils/useAddAppMutation";
export function AccountDialog(props: DialogProps) {
const mutation = useAddAppMutation("office365_calendar");
const mutation = useAddAppMutation("office365_video");
return (
<Dialog name="Account check" {...props}>
<DialogContent>
<DialogHeader
title="Connecting with MS Teams requires a work/school account."
title="Connecting with MS Teams requires a work/school Microsoft account."
subtitle="If you continue with a personal account you will receive an error"
/>
+4 -1
View File
@@ -50,7 +50,10 @@ async function main() {
client_id: process.env.MS_GRAPH_CLIENT_ID,
client_secret: process.env.MS_GRAPH_CLIENT_SECRET,
});
await createApp("msteams", "office365video", ["video"], "office365_video");
await createApp("msteams", "office365video", ["video"], "office365_video", {
client_id: process.env.MS_GRAPH_CLIENT_ID,
client_secret: process.env.MS_GRAPH_CLIENT_SECRET,
});
}
// Video apps
if (process.env.DAILY_API_KEY) {