mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-06-05 18:22:44 +02:00
Update Sequelize where query for User username/email case insensitive
This commit is contained in:
+2
-10
@@ -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
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user