Skip to content

Scheduling infrastructure for absolutely everyone.

Potentially first working version of token fetching for zoom

nicolasf44c8b632677
diff --git a/pages/api/integrations/zoom/callback.ts b/pages/api/integrations/zoom/callback.ts
index 438ca252e7f..9f26f2deea9 100644
--- a/pages/api/integrations/zoom/callback.ts
+++ b/pages/api/integrations/zoom/callback.ts
@@ -1,5 +1,6 @@
import type {NextApiRequest, NextApiResponse} from 'next';
import {getSession} from "next-auth/client";
+import prisma from "../../../../lib/prisma";
const client_id = process.env.ZOOM_CLIENT_ID;
const client_secret = process.env.ZOOM_CLIENT_SECRET;
@@ -25,16 +26,15 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
Authorization: authHeader
}
})
- .then(res => res.text());
- console.log(result);
+ .then(res => res.json());
- /*const credential = await prisma.credential.create({
+ const credential = await prisma.credential.create({
data: {
- type: 'google_calendar',
- key: 'lel',
+ type: 'zoom',
+ key: result.access_token,
userId: session.user.id
}
- });*/
+ });
res.redirect('/integrations');
resolve();