mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
refactor: don't make db request if there is no code
This commit is contained in:
@@ -53,7 +53,7 @@ UserEmail.getEmailForValidation = async (uid) => {
|
||||
let email = '';
|
||||
// check email from confirmObj
|
||||
const code = await db.get(`confirm:byUid:${uid}`);
|
||||
const confirmObj = await db.getObject(`confirm:${code}`);
|
||||
const confirmObj = code ? await db.getObject(`confirm:${code}`) : null;
|
||||
if (confirmObj && confirmObj.email && parseInt(uid, 10) === parseInt(confirmObj.uid, 10)) {
|
||||
email = confirmObj.email;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user