Commit 068ded57 authored by chandi's avatar chandi
Browse files

fix sessionToken injection for socket.io

The past approach only worked when options.query was empty, but this got changed.
parent dccf33f8
......@@ -11,11 +11,11 @@ exports.documentReady = function (hook_name, args, cb) {
// wrap connect() for adding the sessionToken to the query params
const originalConnect = socketio.connect
socketio.connect = function(etherpadBaseUrl, namespace = '/', options = {} ) {
return originalConnect(etherpadBaseUrl, namespace, Object.assign({
query: {
return originalConnect(etherpadBaseUrl, namespace, Object.assign({}, options, {
query: Object.assign({
sessionToken: getSessionToken(document.location)
}
}, options))
}, options.query || {})
}))
}
const pad_utils = require("ep_etherpad-lite/static/js/pad_utils");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment