1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

Guest sharing fixes.

This commit is contained in:
Ylian Saint-Hilaire 2021-09-12 11:17:54 -07:00
parent ac6c4ba1bc
commit 902e71a96f
3 changed files with 18 additions and 3 deletions

View file

@ -4696,8 +4696,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
//var cookie = { a: 5, p: command.p, uid: user._id, gn: command.guestname, nid: node._id, cf: command.consent, pid: publicid };
var cookie = { a: 6, pid: publicid };
//if ((startTime != null) && (expireTime != null)) { command.start = cookie.start = startTime; command.expire = cookie.expire = expireTime; }
//if (command.viewOnly === true) { cookie.vo = 1; }
if ((startTime != null) && (expireTime != null)) { command.start = startTime; command.expire = cookie.e = expireTime; }
const inviteCookie = parent.parent.encodeCookie(cookie, parent.parent.invitationLinkEncryptionKey);
if (inviteCookie == null) { if (command.responseid != null) { try { ws.send(JSON.stringify({ action: 'createDeviceShareLink', responseid: command.responseid, result: 'Unable to generate shareing cookie' })); } catch (ex) { } } return; }