This commit is contained in:
robertpin 2021-07-13 11:55:07 +03:00 committed by GitHub
parent 601ee219e7
commit 7d3953de51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View File

@ -90,7 +90,7 @@ export async function connect(id, password, roomName) {
const state = APP.store.getState(); const state = APP.store.getState();
let { jwt } = state['features/base/jwt']; let { jwt } = state['features/base/jwt'];
if (!jwt && isVpaasMeeting(state)) { if (!jwt && isVpaasMeeting(state, false)) {
jwt = await getJaasJWT(state); jwt = await getJaasJWT(state);
APP.store.dispatch(setJWT(jwt)); APP.store.dispatch(setJWT(jwt));
} }

View File

@ -36,13 +36,16 @@ export function getVpaasTenant(state: Object) {
* Returns true if the current meeting is a vpaas one. * Returns true if the current meeting is a vpaas one.
* *
* @param {Object} state - The state of the app. * @param {Object} state - The state of the app.
* @param {boolean} requiredJwt - Whether jwt is required or not.
* @returns {boolean} * @returns {boolean}
*/ */
export function isVpaasMeeting(state: Object) { export function isVpaasMeeting(state: Object, requiredJwt: boolean = true) {
const { billingCounterUrl, iAmRecorder, iAmSipGateway } = state['features/base/config']; const { billingCounterUrl, iAmRecorder, iAmSipGateway } = state['features/base/config'];
const { jwt } = state['features/base/jwt']; const { jwt } = state['features/base/jwt'];
const isAllowed = iAmRecorder || iAmSipGateway || Boolean(jwt); const jwtBoolean = requiredJwt ? Boolean(jwt) : true;
const isAllowed = iAmRecorder || iAmSipGateway || jwtBoolean;
return Boolean( return Boolean(
billingCounterUrl billingCounterUrl