From 05ddd60c5e257b3773b400ae5aec18b157ce3856 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Sat, 18 Sep 2021 15:20:24 -0400 Subject: [PATCH] dont check empty emails in queue --- src/user/approval.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/user/approval.js b/src/user/approval.js index 639315f00d..cdb49613b6 100644 --- a/src/user/approval.js +++ b/src/user/approval.js @@ -43,8 +43,8 @@ module.exports = function (User) { } const keys = usernames.filter(Boolean).map(username => `registration:queue:name:${username}`); const data = await db.getObjectsFields(keys, ['email']); - const emails = data.map(data => data && data.email); - if (emails.includes(userData.email)) { + const emails = data.map(data => data && data.email).filter(Boolean); + if (userData.email && emails.includes(userData.email)) { throw new Error('[[error:email-taken]]'); } }