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

Fix for #2663. Invitation codes are removed for deleted device groups.

This commit is contained in:
Ylian Saint-Hilaire 2021-05-21 09:01:06 -07:00
parent 76fde352f6
commit 29e30504f0
3 changed files with 8 additions and 2 deletions

View file

@ -1824,7 +1824,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
// Each for a device group that has this invite code.
for (var i in obj.meshes) {
if ((obj.meshes[i].domain == domain.id) && (obj.meshes[i].invite != null) && (obj.meshes[i].invite.codes.indexOf(req.body.inviteCode) >= 0)) {
if ((obj.meshes[i].domain == domain.id) && (parent.meshes[i].deleted == null) && (obj.meshes[i].invite != null) && (obj.meshes[i].invite.codes.indexOf(req.body.inviteCode) >= 0)) {
// Send invitation link, valid for 1 minute.
res.redirect(domain.url + 'agentinvite?c=' + parent.encodeCookie({ a: 4, mid: i, f: obj.meshes[i].invite.flags, expire: 1 }, parent.invitationLinkEncryptionKey) + (req.query.key ? ('&key=' + req.query.key) : ''));
return;