fix: fixed incorrect users lookup (#2229)

This commit is contained in:
Wyatt Johnson
2019-03-18 12:06:29 -06:00
committed by GitHub
parent 53367eeaac
commit cd01aae76c
4 changed files with 92 additions and 13 deletions
+10 -6
View File
@@ -60,13 +60,17 @@ async function upsertUser(
shouldSetDisplayName = false
) {
let user = await User.findOne({
id,
profiles: {
$elemMatch: {
id,
provider,
$or: [
{ id },
{
profiles: {
$elemMatch: {
id,
provider,
},
},
},
},
],
});
if (user) {
user.wasUpserted = false;