mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-12-02 13:14:07 +01:00
Updated + first rough implementation
This commit is contained in:
1 parent
f0f03efe17
commit
405c954b65
5 files changed
+104
-25
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user