robertpin 4 years ago
parent
commit
7d3953de51
No account linked to committer's email address
2 changed files with 6 additions and 3 deletions
  1. 1
    1
      connection.js
  2. 5
    2
      react/features/billing-counter/functions.js

+ 1
- 1
connection.js View File

90
     const state = APP.store.getState();
90
     const state = APP.store.getState();
91
     let { jwt } = state['features/base/jwt'];
91
     let { jwt } = state['features/base/jwt'];
92
 
92
 
93
-    if (!jwt && isVpaasMeeting(state)) {
93
+    if (!jwt && isVpaasMeeting(state, false)) {
94
         jwt = await getJaasJWT(state);
94
         jwt = await getJaasJWT(state);
95
         APP.store.dispatch(setJWT(jwt));
95
         APP.store.dispatch(setJWT(jwt));
96
     }
96
     }

+ 5
- 2
react/features/billing-counter/functions.js View File

36
  * Returns true if the current meeting is a vpaas one.
36
  * Returns true if the current meeting is a vpaas one.
37
  *
37
  *
38
  * @param {Object} state - The state of the app.
38
  * @param {Object} state - The state of the app.
39
+ * @param {boolean} requiredJwt - Whether jwt is required or not.
39
  * @returns {boolean}
40
  * @returns {boolean}
40
  */
41
  */
41
-export function isVpaasMeeting(state: Object) {
42
+export function isVpaasMeeting(state: Object, requiredJwt: boolean = true) {
42
     const { billingCounterUrl, iAmRecorder, iAmSipGateway } = state['features/base/config'];
43
     const { billingCounterUrl, iAmRecorder, iAmSipGateway } = state['features/base/config'];
43
     const { jwt } = state['features/base/jwt'];
44
     const { jwt } = state['features/base/jwt'];
44
 
45
 
45
-    const isAllowed = iAmRecorder || iAmSipGateway || Boolean(jwt);
46
+    const jwtBoolean = requiredJwt ? Boolean(jwt) : true;
47
+
48
+    const isAllowed = iAmRecorder || iAmSipGateway || jwtBoolean;
46
 
49
 
47
     return Boolean(
50
     return Boolean(
48
         billingCounterUrl
51
         billingCounterUrl

Loading…
Cancel
Save