Very rudimentary development version of zoom auth #4

pull/277/head
nicolas 2021-06-11 02:08:47 +02:00
parent 46474c9c70
commit 615e59cde7
1 changed files with 3 additions and 2 deletions

View File

@ -21,7 +21,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
// Convert to token // Convert to token
const options = { const options = {
method: 'POST', method: 'POST',
qs: { body: {
grant_type: 'authorization_code', grant_type: 'authorization_code',
code, code,
redirect_uri: authUrl redirect_uri: authUrl
@ -32,7 +32,8 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
}; };
return new Promise( async (resolve, reject) => { return new Promise( async (resolve, reject) => {
const result = await fetch('https://zoom.us/oauth/token', options); const result = await fetch('https://zoom.us/oauth/token', options)
.then(res => res.text());
console.log(result); console.log(result);
/*const credential = await prisma.credential.create({ /*const credential = await prisma.credential.create({