mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
fix(emails): dont allow retrieving user data if showemail is false @julianlam
This commit is contained in:
committed by
Julian Lam
parent
6694bdd550
commit
7d115c8ef2
@@ -46,6 +46,12 @@ userController.getUserDataByField = async function (callerUid, field, fieldValue
|
|||||||
uid = await user.getUidByUsername(fieldValue);
|
uid = await user.getUidByUsername(fieldValue);
|
||||||
} else if (field === 'email') {
|
} else if (field === 'email') {
|
||||||
uid = await user.getUidByEmail(fieldValue);
|
uid = await user.getUidByEmail(fieldValue);
|
||||||
|
if (uid) {
|
||||||
|
const settings = await user.getSettings(uid);
|
||||||
|
if (settings && !settings.showemail) {
|
||||||
|
uid = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!uid) {
|
if (!uid) {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Reference in New Issue
Block a user