mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-11-28 11:22:43 +01:00
Update scanner v3, add isActive support for users
This commit is contained in:
1 parent
ddbf678a8b
commit
4e92ea3992
13 files changed
+230
-160
No files matched your search
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user