mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-17 17:42:07 +02:00
Updated + first rough implementation
This commit is contained in:
parent
f0f03efe17
commit
405c954b65
5 changed files with 104 additions and 25 deletions
|
@ -194,6 +194,25 @@ class User extends Model {
|
|||
return this.getOldUser(user)
|
||||
}
|
||||
|
||||
/**
|
||||
* Get user by email case insensitive
|
||||
* @param {string} username
|
||||
* @returns {Promise<oldUser|null>} returns null if not found
|
||||
*/
|
||||
static async getUserByEmail(email) {
|
||||
if (!email) return null
|
||||
const user = await this.findOne({
|
||||
where: {
|
||||
email: {
|
||||
[Op.like]: email
|
||||
}
|
||||
},
|
||||
include: this.sequelize.models.mediaProgress
|
||||
})
|
||||
if (!user) return null
|
||||
return this.getOldUser(user)
|
||||
}
|
||||
|
||||
/**
|
||||
* Get user by id
|
||||
* @param {string} userId
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue