|
@@ -11,11 +11,14 @@ import {
|
11
|
11
|
connectionFailed
|
12
|
12
|
} from './react/features/base/connection/actions';
|
13
|
13
|
import { openDialog } from './react/features/base/dialog/actions';
|
|
14
|
+import { setJWT } from './react/features/base/jwt';
|
14
|
15
|
import {
|
15
|
16
|
isFatalJitsiConnectionError,
|
16
|
17
|
JitsiConnectionErrors,
|
17
|
18
|
JitsiConnectionEvents
|
18
|
19
|
} from './react/features/base/lib-jitsi-meet';
|
|
20
|
+import { isVpaasMeeting } from './react/features/billing-counter/functions';
|
|
21
|
+import { getJaasJWT } from './react/features/jaas/functions';
|
19
|
22
|
import { setPrejoinDisplayNameRequired } from './react/features/prejoin/actions';
|
20
|
23
|
const logger = Logger.getLogger(__filename);
|
21
|
24
|
|
|
@@ -82,9 +85,15 @@ function checkForAttachParametersAndConnect(id, password, connection) {
|
82
|
85
|
* @returns {Promise<JitsiConnection>} connection if
|
83
|
86
|
* everything is ok, else error.
|
84
|
87
|
*/
|
85
|
|
-export function connect(id, password, roomName) {
|
|
88
|
+export async function connect(id, password, roomName) {
|
86
|
89
|
const connectionConfig = Object.assign({}, config);
|
87
|
|
- const { jwt } = APP.store.getState()['features/base/jwt'];
|
|
90
|
+ const state = APP.store.getState();
|
|
91
|
+ let { jwt } = state['features/base/jwt'];
|
|
92
|
+
|
|
93
|
+ if (!jwt && isVpaasMeeting(state)) {
|
|
94
|
+ jwt = await getJaasJWT(state);
|
|
95
|
+ APP.store.dispatch(setJWT(jwt));
|
|
96
|
+ }
|
88
|
97
|
|
89
|
98
|
// Use Websocket URL for the web app if configured. Note that there is no 'isWeb' check, because there's assumption
|
90
|
99
|
// that this code executes only on web browsers/electron. This needs to be changed when mobile and web are unified.
|