dont allow duplicate emails (#5452)

Signed-off-by: Simon Smith <simonsmith5521@gmail.com>
This commit is contained in:
Simon Smith 2023-10-21 01:29:16 +01:00 committed by GitHub
parent 1002bbb952
commit e35af29ad0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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) {