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