dont allow duplicate emails (#5452)
Signed-off-by: Simon Smith <simonsmith5521@gmail.com>
Simon Smith committed
Oct 21, 2023 at 01:29 UTC
e35af29ad0b0e2f58065b4125c0da87a18f6ff26
1 file changed
+7
meshuser.js
+7
@@ -5697,6 +5697,13 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
5697
return;
5698
}
5699
5700
+ for(var x in parent.users) {
5701
+ if(parent.users[x].email==command.email){
5702
+ displayNotificationMessage("Email address already in use", "New Account", "ServerNotify");
5703
+ return;
5704
+ }
5705
+ }
5706
+
5707
// Check if we exceed the maximum number of user accounts
5708
db.isMaxType(newuserdomain.limits.maxuseraccounts, 'user', newuserdomain.id, function (maxExceed) {
5709
if (maxExceed) {