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

Fixed agent invite codes to make them unique per domain.

This commit is contained in:
Ylian Saint-Hilaire 2020-04-30 18:52:45 -07:00
parent ab2dd569c5
commit 3b11d528c3
3 changed files with 3 additions and 3 deletions

View file

@ -1481,7 +1481,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].invite != null) && (obj.meshes[i].invite.codes.indexOf(req.body.inviteCode) >= 0)) {
if ((obj.meshes[i].domain == domain.id) && (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;