mirror of
https://github.com/wassname/talk.git
synced 2026-08-15 12:55:10 +08:00
fix: fixed incorrect users lookup (#2229)
This commit is contained in:
+10
-6
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user