Removed scopes variable

pull/277/head
nicolas 2021-06-11 02:17:22 +02:00
parent f44c8b6326
commit a9a569f876
1 changed files with 1 additions and 4 deletions

View File

@ -5,8 +5,6 @@ import prisma from "../../../../lib/prisma";
const client_id = process.env.ZOOM_CLIENT_ID;
const client_secret = process.env.ZOOM_CLIENT_SECRET;
const scopes = ['meeting:write:admin', 'meeting:write', 'meeting:read:admin', 'meeting:read'];
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
const { code } = req.query;
@ -16,7 +14,6 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
if (!session) { res.status(401).json({message: 'You must be logged in to do this'}); return; }
const redirectUri = encodeURI(process.env.BASE_URL + '/api/integrations/zoom/callback');
const authUrl = 'https://zoom.us/oauth/authorize?response_type=code&client_id=' + client_id + '&redirect_uri=' + redirectUri;
const authHeader = 'Basic ' + Buffer.from(client_id + ':' + client_secret).toString('base64');
return new Promise( async (resolve, reject) => {
@ -28,7 +25,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
})
.then(res => res.json());
const credential = await prisma.credential.create({
await prisma.credential.create({
data: {
type: 'zoom',
key: result.access_token,