Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function initFayeClient() {
fayeClient = new faye.Client('/io/live');
fayeClient.addExtension({
outgoing(message, callback) {
// If session is new & token does not exist, request a new one
if (!token) {
tokenUpdate(() => {
message.token = token;
callback(message);
});
return;
}
message.token = token;
callback(message);
},
incoming(message, callback) {