mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-06-01 00:01:34 +00:00
Update Sequelize where query for User username/email case insensitive
This commit is contained in:
parent
1bad2d9072
commit
499b52b4dd
1 changed files with 2 additions and 10 deletions
|
|
@ -352,11 +352,7 @@ class User extends Model {
|
|||
if (cachedUser) return cachedUser
|
||||
|
||||
const user = await this.findOne({
|
||||
where: {
|
||||
username: {
|
||||
[sequelize.Op.like]: username
|
||||
}
|
||||
},
|
||||
where: sequelize.where(sequelize.fn('lower', sequelize.col('username')), username.toLowerCase()),
|
||||
include: this.sequelize.models.mediaProgress
|
||||
})
|
||||
|
||||
|
|
@ -377,11 +373,7 @@ class User extends Model {
|
|||
if (cachedUser) return cachedUser
|
||||
|
||||
const user = await this.findOne({
|
||||
where: {
|
||||
email: {
|
||||
[sequelize.Op.like]: email
|
||||
}
|
||||
},
|
||||
where: sequelize.where(sequelize.fn('lower', sequelize.col('email')), email.toLowerCase()),
|
||||
include: this.sequelize.models.mediaProgress
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue