mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
fix email search
This commit is contained in:
@@ -42,9 +42,9 @@ api.getHero = {
|
||||
} else if (validator.isEmail(userIdentifier)) {
|
||||
const emailFields = [
|
||||
'auth.local.email',
|
||||
'auth.google.email',
|
||||
'auth.apple.email',
|
||||
'auth.facebook.email',
|
||||
'auth.google.emails.value',
|
||||
'auth.apple.emails.value',
|
||||
'auth.facebook.emails.value',
|
||||
];
|
||||
for (const field of emailFields) {
|
||||
const emailQuery = { [field]: userIdentifier };
|
||||
@@ -53,7 +53,7 @@ api.getHero = {
|
||||
.select('contributor backer profile auth')
|
||||
.lean()
|
||||
.exec();
|
||||
if (found && found.size >= 0) {
|
||||
if (found) {
|
||||
users.push(found);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user