diff options
Diffstat (limited to 'server')
-rw-r--r-- | server/models/account/user.ts | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/server/models/account/user.ts b/server/models/account/user.ts index 27262af42..4c2c5e278 100644 --- a/server/models/account/user.ts +++ b/server/models/account/user.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { FindOptions, literal, Op, QueryTypes } from 'sequelize' | 1 | import { FindOptions, literal, Op, QueryTypes, where, fn, col } from 'sequelize' |
2 | import { | 2 | import { |
3 | AfterDestroy, | 3 | AfterDestroy, |
4 | AfterUpdate, | 4 | AfterUpdate, |
@@ -465,7 +465,11 @@ export class UserModel extends Model<UserModel> { | |||
465 | 465 | ||
466 | const query = { | 466 | const query = { |
467 | where: { | 467 | where: { |
468 | [ Op.or ]: [ { username: { [ Op.iLike ]: username } }, { email } ] | 468 | [ Op.or ]: [ |
469 | where(fn('lower', col('username')), fn('lower', username)), | ||
470 | |||
471 | { email } | ||
472 | ] | ||
469 | } | 473 | } |
470 | } | 474 | } |
471 | 475 | ||