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