We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a722ec5 commit cff199dCopy full SHA for cff199d
1 file changed
server/models/user.ts
@@ -287,11 +287,7 @@ userSchema.statics.findByEmailOrUsername = async function findByEmailOrUsername(
287
: value.indexOf('@') > -1;
288
289
// do the case insensitive stuff
290
- if (
291
- arguments.length === 2 &&
292
- typeof options === 'object' &&
293
- options.caseInsensitive
294
- ) {
+ if (options?.caseInsensitive) {
295
const query = isEmail ? { email: value } : { username: value };
296
const foundUser = await user
297
.findOne(query)
0 commit comments