mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-05 06:54:59 +02:00
Update scanner v3, add isActive support for users
This commit is contained in:
parent
394d312282
commit
beaa1e14bb
13 changed files with 230 additions and 160 deletions
|
@ -48,6 +48,10 @@ class Auth {
|
|||
var user = await this.verifyToken(token)
|
||||
if (!user) {
|
||||
Logger.error('Verify Token User Not Found', token)
|
||||
return res.sendStatus(404)
|
||||
}
|
||||
if (!user.isActive) {
|
||||
Logger.error('Verify Token User is disabled', token, user.username)
|
||||
return res.sendStatus(403)
|
||||
}
|
||||
req.user = user
|
||||
|
@ -95,6 +99,10 @@ class Auth {
|
|||
return res.json({ error: 'User not found' })
|
||||
}
|
||||
|
||||
if (!user.isActive) {
|
||||
return res.json({ error: 'User unavailable' })
|
||||
}
|
||||
|
||||
// Check passwordless root user
|
||||
if (user.id === 'root' && (!user.pash || user.pash === '')) {
|
||||
if (password) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue