From 31670d37b84ef1bc45ebc5e258cecd0a4f19d8b4 Mon Sep 17 00:00:00 2001 From: nicolas Date: Sun, 13 Jun 2021 16:18:55 +0200 Subject: [PATCH] Fixed api urls and env variable names --- lib/videoClient.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/videoClient.ts b/lib/videoClient.ts index 811a67d562..0f6efcfc1d 100644 --- a/lib/videoClient.ts +++ b/lib/videoClient.ts @@ -17,7 +17,7 @@ function handleErrorsRaw(response) { const zoomAuth = (credential) => { const isExpired = (expiryDate) => expiryDate < +(new Date()); - const authHeader = 'Basic ' + Buffer.from(process.env.CLIENT_ID + ':' + process.env.CLIENT_SECRET).toString('base64'); + const authHeader = 'Basic ' + Buffer.from(process.env.ZOOM_CLIENT_ID + ':' + process.env.ZOOM_CLIENT_SECRET).toString('base64'); const refreshAccessToken = (refreshToken) => fetch('https://zoom.us/oauth/token', { method: 'POST', @@ -137,7 +137,7 @@ const ZoomVideo = (credential): VideoApiAdapter => { });*/ }, //TODO Also add the client user to the meeting after creation - createMeeting: (meeting: VideoMeeting) => auth.getToken().then(accessToken => fetch('https://zoom.us/users/me/meetings', { + createMeeting: (meeting: VideoMeeting) => auth.getToken().then(accessToken => fetch('https://api.zoom.us/v2/users/me/meetings', { method: 'POST', headers: { 'Authorization': 'Bearer ' + accessToken, @@ -145,13 +145,13 @@ const ZoomVideo = (credential): VideoApiAdapter => { }, body: JSON.stringify(translateMeeting(meeting)) }).then(handleErrorsJson)), - deleteMeeting: (uid: String) => auth.getToken().then(accessToken => fetch('https://zoom.us/meetings/' + uid, { + deleteMeeting: (uid: String) => auth.getToken().then(accessToken => fetch('https://api.zoom.us/v2/meetings/' + uid, { method: 'DELETE', headers: { 'Authorization': 'Bearer ' + accessToken } }).then(handleErrorsRaw)), - updateMeeting: (uid: String, meeting: VideoMeeting) => auth.getToken().then(accessToken => fetch('https://zoom.us/meetings/' + uid, { + updateMeeting: (uid: String, meeting: VideoMeeting) => auth.getToken().then(accessToken => fetch('https://api.zoom.us/v2/meetings/' + uid, { method: 'PATCH', headers: { 'Authorization': 'Bearer ' + accessToken,