Przeglądaj źródła

feat(conference-request): Attach token to the conference request sent to jicofo. (#2782)

* feat(conference-request): Attach token to the conference request sent to jicofo.

* squash: Skip adding header when there is no token.
master
Дамян Минков 6 miesięcy temu
rodzic
commit
1d19d5e77c
No account linked to committer's email address
1 zmienionych plików z 6 dodań i 2 usunięć
  1. 6
    2
      modules/xmpp/moderator.js

+ 6
- 2
modules/xmpp/moderator.js Wyświetl plik

218
         elem.c('conference', {
218
         elem.c('conference', {
219
             xmlns: 'http://jitsi.org/protocol/focus',
219
             xmlns: 'http://jitsi.org/protocol/focus',
220
             room: roomJid,
220
             room: roomJid,
221
-            'machine-uid': conferenceRequest.machineUid
221
+            'machine-uid': conferenceRequest.machineUid,
222
+            token: this.xmpp.token
222
         });
223
         });
223
 
224
 
224
         if (conferenceRequest.sessionId) {
225
         if (conferenceRequest.sessionId) {
323
                 fetch(this.targetUrl, {
324
                 fetch(this.targetUrl, {
324
                     method: 'POST',
325
                     method: 'POST',
325
                     body: JSON.stringify(this._createConferenceRequest(roomJid)),
326
                     body: JSON.stringify(this._createConferenceRequest(roomJid)),
326
-                    headers: { 'Content-Type': 'application/json' }
327
+                    headers: {
328
+                        'Content-Type': 'application/json',
329
+                        ...this.xmpp.token ? { 'Authorization': `Bearer ${this.xmpp.token}` } : {}
330
+                    }
327
                 })
331
                 })
328
                     .then(response => {
332
                     .then(response => {
329
                         if (!response.ok) {
333
                         if (!response.ok) {

Ładowanie…
Anuluj
Zapisz