Skip to content

Commit

Permalink
fix: user query field
Browse files Browse the repository at this point in the history
  • Loading branch information
marcuspang committed Sep 29, 2023
1 parent c1b1888 commit 3f5127a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/models/User.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,16 @@ userSchema.pre('save', function () {

userSchema.static(
'findByDidOrAuth',
async function (did: string, idToken?: string) {
async function (did: string, address?: string) {
return User.findOne({
$or: [
{
did: {
$eq: did
}
},
...(idToken !== undefined
? [{ _id: { $eq: idToken.toUpperCase() } }]
...(address !== undefined
? [{ 'wallets.address': { $eq: address.toUpperCase() } }]
: [])
]
});
Expand Down

0 comments on commit 3f5127a

Please sign in to comment.