Browse Source

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 months ago
parent
commit
1d19d5e77c
No account linked to committer's email address
1 changed files with 6 additions and 2 deletions
  1. 6
    2
      modules/xmpp/moderator.js

+ 6
- 2
modules/xmpp/moderator.js View File

@@ -218,7 +218,8 @@ export default class Moderator extends Listenable {
218 218
         elem.c('conference', {
219 219
             xmlns: 'http://jitsi.org/protocol/focus',
220 220
             room: roomJid,
221
-            'machine-uid': conferenceRequest.machineUid
221
+            'machine-uid': conferenceRequest.machineUid,
222
+            token: this.xmpp.token
222 223
         });
223 224
 
224 225
         if (conferenceRequest.sessionId) {
@@ -323,7 +324,10 @@ export default class Moderator extends Listenable {
323 324
                 fetch(this.targetUrl, {
324 325
                     method: 'POST',
325 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 332
                     .then(response => {
329 333
                         if (!response.ok) {

Loading…
Cancel
Save