Fix attached client not having token on login

This commit is contained in:
Pavel Djundik 2017-09-17 11:33:16 +03:00
parent 833bdfa2aa
commit 2f15ab3999

View file

@ -237,7 +237,6 @@ function initializeClient(socket, client, token, lastMessage) {
socket.on("disconnect", function() {
client.clientDetach(socket.id);
});
client.clientAttach(socket.id, token);
socket.on(
"input",
@ -429,6 +428,8 @@ function initializeClient(socket, client, token, lastMessage) {
socket.join(client.id);
const sendInitEvent = (tokenToSend) => {
client.clientAttach(socket.id, token);
let networks = client.networks;
if (lastMessage > -1) {