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

fix name display for oauth (#5980)

Signed-off-by: si458 <simonsmith5521@gmail.com>
This commit is contained in:
Simon Smith 2024-04-01 15:48:01 +01:00 committed by GitHub
parent d2a0946f22
commit 9294488d4e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 0 deletions

View file

@ -815,6 +815,14 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
if ((xipkvmport != null) && (xipkvmport.sessions != null)) { docs[i].sessions = xipkvmport.sessions; }
}
// Patch node links with names, like meshes links with names
for (var a in docs[i].links) {
if (!docs[i].links[a].name) {
if (parent.users[a].realname) { docs[i].links[a].name = parent.users[a].realname; }
else if (parent.users[a].name) { docs[i].links[a].name = parent.users[a].name; }
}
}
r[meshid].push(docs[i]);
}
const response = { action: 'nodes', responseid: command.responseid, nodes: r, tag: command.tag };