-
-
Save DanyF-github/4e2571d9fe97fcda789f9447b92e0bf0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// server/src/graphql/videoApi.js | |
... | |
const joinSession = async (_, { uuid }, __, ___) => { | |
// check if a uuid has been provided | |
if (!uuid) { | |
throw new Error(INTERNAL_ERROR); | |
} | |
// Retrieve the session from the database | |
const [videocall] = videocalls.filter(videocall => videocall.uuid === uuid); | |
// initialize the opentok client | |
initializeOpentok(); | |
// generating the token | |
const token = generateToken(videocall.sessionId); | |
// | |
return { | |
uuid, | |
token, | |
session: videocall.sessionId, | |
apiKey | |
}; | |
}; | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment