Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
self.login = function(jid, password) {
client = XMPP.createClient({
jid: jid,
password: password,
// If you have a .well-known/host-meta.json file for your
// domain, the connection transport config can be skipped.
transport: 'bosh',
boshURL: 'http://ums.ihs.broadsoft.com:5280'
// (or `boshURL` if using 'bosh' as the transport)
});
return client;
};
setup() {
this.stream = createClient({
server: Endpoints.EPIC_PROD_ENV,
transports: {
websocket: `wss://${Endpoints.XMPP_SERVER}`,
bosh: false,
},
credentials: {
jid: `${this.client.authenticator.accountId}@${Endpoints.EPIC_PROD_ENV}`,
host: Endpoints.EPIC_PROD_ENV,
username: this.client.authenticator.accountId,
password: this.client.authenticator.accessToken,
},
resource: this.resource, // to make it seen online INSIDE the game.
});
function (cb) {
app.state = new AppState();
app.me = window.me = new MeModel(profile);
window.onbeforeunload = function () {
if (app.api.sessionStarted) {
app.api.disconnect();
}
};
self.api = window.client = StanzaIO.createClient(config);
client.use(pushNotifications);
xmppEventHandlers(self.api, self);
self.api.once('session:started', function () {
app.state.hasConnected = true;
cb();
});
self.api.connect();
},
function (cb) {
handleJoinMUC: function (e) {
e.preventDefault();
var mucjid = this.$('#joinmuc').val();
me.mucs.add({
id: mucjid,
name: mucjid,
jid: new XMPP.JID(mucjid),
nick: me.nick,
autoJoin: false
});
me.mucs.get(mucjid).join();
}
});