diff --git a/meshuser.js b/meshuser.js index 64cb6a30..244ca760 100644 --- a/meshuser.js +++ b/meshuser.js @@ -676,18 +676,6 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use // TODO: Send the message of user sessions connected to other servers. - break; - } - case 'authcookie': - { - // Renew the authentication cookie - try { - ws.send(JSON.stringify({ - action: 'authcookie', - cookie: parent.parent.encodeCookie({ userid: user._id, domainid: domain.id, ip: req.clientIp }, parent.parent.loginCookieEncryptionKey), - rcookie: parent.parent.encodeCookie({ ruserid: user._id }, parent.parent.loginCookieEncryptionKey) - })); - } catch (ex) { } break; } case 'logincookie': @@ -5555,6 +5543,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use 'adduser': serverCommandAddUser, 'adduserbatch': serverCommandAddUserBatch, 'addusertousergroup': serverCommandAddUserToUserGroup, + 'authcookie': serverCommandAuthCookie, 'files': serverCommandFiles, 'getnetworkinfo': serverCommandGetNetworkInfo, 'getsysinfo': serverCommandGetSysInfo, @@ -5916,6 +5905,16 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use if (command.responseid != null) { try { ws.send(JSON.stringify({ action: 'addusertousergroup', responseid: command.responseid, result: 'ok', added: addedCount, failed: failCount })); } catch (ex) { } } } + function serverCommandAuthCookie(command) { + try { + ws.send(JSON.stringify({ + action: 'authcookie', + cookie: parent.parent.encodeCookie({ userid: user._id, domainid: domain.id, ip: req.clientIp }, parent.parent.loginCookieEncryptionKey), + rcookie: parent.parent.encodeCookie({ ruserid: user._id }, parent.parent.loginCookieEncryptionKey) + })); + } catch (ex) { } + } + function serverCommandFiles(command) { // Send the full list of server files to the browser app updateUserFiles(user, ws, domain);