Fixed api urls and env variable names

pull/277/head
nicolas 2021-06-13 16:18:55 +02:00
parent bc8c58e57c
commit 31670d37b8
1 changed files with 4 additions and 4 deletions

View File

@ -17,7 +17,7 @@ function handleErrorsRaw(response) {
const zoomAuth = (credential) => { const zoomAuth = (credential) => {
const isExpired = (expiryDate) => expiryDate < +(new Date()); 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', { const refreshAccessToken = (refreshToken) => fetch('https://zoom.us/oauth/token', {
method: 'POST', method: 'POST',
@ -137,7 +137,7 @@ const ZoomVideo = (credential): VideoApiAdapter => {
});*/ });*/
}, },
//TODO Also add the client user to the meeting after creation //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', method: 'POST',
headers: { headers: {
'Authorization': 'Bearer ' + accessToken, 'Authorization': 'Bearer ' + accessToken,
@ -145,13 +145,13 @@ const ZoomVideo = (credential): VideoApiAdapter => {
}, },
body: JSON.stringify(translateMeeting(meeting)) body: JSON.stringify(translateMeeting(meeting))
}).then(handleErrorsJson)), }).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', method: 'DELETE',
headers: { headers: {
'Authorization': 'Bearer ' + accessToken 'Authorization': 'Bearer ' + accessToken
} }
}).then(handleErrorsRaw)), }).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', method: 'PATCH',
headers: { headers: {
'Authorization': 'Bearer ' + accessToken, 'Authorization': 'Bearer ' + accessToken,