From e35af29ad0b0e2f58065b4125c0da87a18f6ff26 Mon Sep 17 00:00:00 2001 From: Simon Smith Date: Sat, 21 Oct 2023 01:29:16 +0100 Subject: [PATCH] dont allow duplicate emails (#5452) Signed-off-by: Simon Smith --- meshuser.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/meshuser.js b/meshuser.js index 237fe1b7..82d921cf 100644 --- a/meshuser.js +++ b/meshuser.js @@ -5697,6 +5697,13 @@ 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"); + return; + } + } + // Check if we exceed the maximum number of user accounts db.isMaxType(newuserdomain.limits.maxuseraccounts, 'user', newuserdomain.id, function (maxExceed) { if (maxExceed) {