JWT token is now passed as BOSH URL parameter.
This commit is contained in:
parent
9d60af1a9d
commit
ca8a147ea6
|
@ -325,8 +325,16 @@ function registerListeners() {
|
|||
"dialog.connectError", pres);
|
||||
});
|
||||
APP.xmpp.addListener(XMPPEvents.ROOM_CONNECT_ERROR, function (pres) {
|
||||
UI.messageHandler.openReportDialog(null,
|
||||
"dialog.connectError", pres);
|
||||
if (config.token &&
|
||||
$(pres).find(
|
||||
'>error[type="cancel"]' +
|
||||
'>not-allowed[xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"]'
|
||||
).length) {
|
||||
messageHandler.showError("dialog.error", "dialog.tokenAuthFailed");
|
||||
} else {
|
||||
UI.messageHandler.openReportDialog(null,
|
||||
"dialog.connectError", pres);
|
||||
}
|
||||
});
|
||||
|
||||
APP.xmpp.addListener(XMPPEvents.READY_TO_JOIN, function () {
|
||||
|
|
|
@ -562,10 +562,6 @@ module.exports = function(XMPP, eventEmitter) {
|
|||
delete this.presMap["startMuted"];
|
||||
}
|
||||
|
||||
if (config.token) {
|
||||
pres.c('token', { xmlns: 'http://jitsi.org/jitmeet/auth-token'}).t(config.token).up();
|
||||
}
|
||||
|
||||
pres.up();
|
||||
this.connection.send(pres);
|
||||
},
|
||||
|
|
|
@ -308,21 +308,16 @@ var XMPP = {
|
|||
configDomain = config.hosts.domain;
|
||||
}
|
||||
var jid = configDomain || window.location.hostname;
|
||||
var password = null;
|
||||
if (config.token) {
|
||||
password = config.token;
|
||||
if (config.id) {
|
||||
jid = config.id + "@" + jid;
|
||||
} else {
|
||||
jid = generateUserName() + "@" + jid;
|
||||
}
|
||||
}
|
||||
connect(jid, password);
|
||||
connect(jid);
|
||||
},
|
||||
createConnection: function () {
|
||||
var bosh = config.bosh || '/http-bind';
|
||||
// adds the room name used to the bosh connection
|
||||
return new Strophe.Connection(bosh + '?room=' + APP.UI.getRoomNode());
|
||||
bosh += '?room=' + APP.UI.getRoomNode();
|
||||
if (config.token) {
|
||||
bosh += "&token=" + config.token;
|
||||
}
|
||||
return new Strophe.Connection(bosh);
|
||||
},
|
||||
getStatusString: function (status) {
|
||||
return Strophe.getStatusString(status);
|
||||
|
|
Loading…
Reference in New Issue