dont check empty emails in queue

isekai-main
Barış Soner Uşaklı 3 years ago
parent 58ac55c16a
commit 05ddd60c5e

@ -43,8 +43,8 @@ module.exports = function (User) {
} }
const keys = usernames.filter(Boolean).map(username => `registration:queue:name:${username}`); const keys = usernames.filter(Boolean).map(username => `registration:queue:name:${username}`);
const data = await db.getObjectsFields(keys, ['email']); const data = await db.getObjectsFields(keys, ['email']);
const emails = data.map(data => data && data.email); const emails = data.map(data => data && data.email).filter(Boolean);
if (emails.includes(userData.email)) { if (userData.email && emails.includes(userData.email)) {
throw new Error('[[error:email-taken]]'); throw new Error('[[error:email-taken]]');
} }
} }

Loading…
Cancel
Save