fix email in use meshctrl reply #6036

Signed-off-by: si458 <simonsmith5521@gmail.com>
This commit is contained in:
si458 2024-04-18 20:48:58 +01:00
parent f39b6f8859
commit 1747ff7550
1 changed files with 8 additions and 4 deletions

View File

@ -5792,10 +5792,14 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
}
return;
}
for(var x in parent.users) {
if(parent.users[x].email==command.email){
displayNotificationMessage("Email address already in use", "New Account", "ServerNotify");
for (var x in parent.users) {
if (parent.users[x].email == command.email){
if (command.responseid != null) {
obj.send({ action: 'adduser', responseid: command.responseid, result: "Email address already in use", msgid: errid });
} else {
// Send error back, user not found.
displayNotificationMessage("Email address already in use", "New Account", 'ServerNotify', 1, errid, args);
}
return;
}
}