use enter api to get meetingId, authToken, etc

This commit is contained in:
Anton Georgiev 2017-06-09 16:07:27 -04:00
parent a50d3d7895
commit 367b905ec5

View File

@ -13,10 +13,23 @@ export function joinRouteHandler(nextState, replace, callback) {
callback();
}
// Auth.set(meetingID, userID, authToken); // TODO
// replace({ pathname: '/' });
callback();
};
// use enter api to get params for the client
const url = `/bigbluebutton/api/enter?sessionToken=${sessionToken}`;
let BBBParameters;
fetch(url)
.then(response => response.json())
.then((data) => {
BBBParameters = data.response;
console.log(BBBParameters);
const { meetingID, internalUserID, authToken } = BBBParameters;
Auth.set(meetingID, internalUserID, authToken);
replace({ pathname: '/' });
callback();
});
}
export function logoutRouteHandler(nextState, replace, callback) {
const { meetingID, userID, authToken } = nextState.params;