fix(jaas) fix vpaas condition
This commit is contained in:
parent
17f77a4246
commit
420a7d8110
|
@ -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));
|
||||
}
|
||||
|
|
|
@ -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
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -592,7 +592,7 @@ function _mapStateToProps(state) {
|
|||
return {
|
||||
..._abstractMapStateToProps(state),
|
||||
_footerTextEnabled: footerTextEnabled,
|
||||
_isVpaas: isVpaasMeeting(state, false)
|
||||
_isVpaas: isVpaasMeeting(state)
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue