Use lower instead of ilike to login users
This commit is contained in:
parent
41ee83423c
commit
c4a1811ea8
|
@ -169,7 +169,7 @@ function getZanataContributors () {
|
||||||
|
|
||||||
function getContributorsBlacklist () {
|
function getContributorsBlacklist () {
|
||||||
return {
|
return {
|
||||||
'Florian Bigard': true,
|
'Bigard Florian': true,
|
||||||
'chocobozzz': true,
|
'chocobozzz': true,
|
||||||
'Rigel': true
|
'Rigel': true
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { FindOptions, literal, Op, QueryTypes } from 'sequelize'
|
import { FindOptions, literal, Op, QueryTypes, where, fn, col } from 'sequelize'
|
||||||
import {
|
import {
|
||||||
AfterDestroy,
|
AfterDestroy,
|
||||||
AfterUpdate,
|
AfterUpdate,
|
||||||
|
@ -465,7 +465,11 @@ export class UserModel extends Model<UserModel> {
|
||||||
|
|
||||||
const query = {
|
const query = {
|
||||||
where: {
|
where: {
|
||||||
[ Op.or ]: [ { username: { [ Op.iLike ]: username } }, { email } ]
|
[ Op.or ]: [
|
||||||
|
where(fn('lower', col('username')), fn('lower', username)),
|
||||||
|
|
||||||
|
{ email }
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue