fix(jaas) fix vpaas condition

This commit is contained in:
Tudor-Ovidiu Avram 2021-07-16 15:14:37 +03:00 committed by Дамян Минков
parent 17f77a4246
commit 420a7d8110
4 changed files with 5 additions and 12 deletions

View File

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

View File

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

View File

@ -340,7 +340,7 @@ const _mapStateToProps = state => {
bannerCfg: state['features/base/config'].chromeExtensionBanner || emptyObject,
conference: getCurrentConference(state),
iAmRecorder: state['features/base/config'].iAmRecorder,
isVpaas: isVpaasMeeting(state, false)
isVpaas: isVpaasMeeting(state)
};
};

View File

@ -592,7 +592,7 @@ function _mapStateToProps(state) {
return {
..._abstractMapStateToProps(state),
_footerTextEnabled: footerTextEnabled,
_isVpaas: isVpaasMeeting(state, false)
_isVpaas: isVpaasMeeting(state)
};
}