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

3
db.js
View file

@ -201,6 +201,9 @@ module.exports.CreateDB = function (parent, func) {
// Make sure all mesh types are number type, if not, fix it.
if (typeof docs[i].mtype == 'string') { docs[i].mtype = parseInt(docs[i].mtype); meshChange = true; }
// If the device group is deleted, remove any invite codes
if (docs[i].deleted && docs[i].invite) { delete docs[i].invite; meshChange = true; }
// Take a look at the links
if (docs[i].links != null) {
for (var j in docs[i].links) {