Removed scopes variable
This commit is contained in:
parent
f44c8b6326
commit
a9a569f876
1 changed files with 1 additions and 4 deletions
|
@ -5,8 +5,6 @@ import prisma from "../../../../lib/prisma";
|
||||||
const client_id = process.env.ZOOM_CLIENT_ID;
|
const client_id = process.env.ZOOM_CLIENT_ID;
|
||||||
const client_secret = process.env.ZOOM_CLIENT_SECRET;
|
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) {
|
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
|
||||||
const { code } = req.query;
|
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; }
|
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 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');
|
const authHeader = 'Basic ' + Buffer.from(client_id + ':' + client_secret).toString('base64');
|
||||||
|
|
||||||
return new Promise( async (resolve, reject) => {
|
return new Promise( async (resolve, reject) => {
|
||||||
|
@ -28,7 +25,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
||||||
})
|
})
|
||||||
.then(res => res.json());
|
.then(res => res.json());
|
||||||
|
|
||||||
const credential = await prisma.credential.create({
|
await prisma.credential.create({
|
||||||
data: {
|
data: {
|
||||||
type: 'zoom',
|
type: 'zoom',
|
||||||
key: result.access_token,
|
key: result.access_token,
|
||||||
|
|
Loading…
Reference in a new issue