mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-22 03:44:28 +02:00
Fix use first accessible library depending on display order, default library id checked on server when authenticating
This commit is contained in:
parent
0dd219f303
commit
08e1782253
7 changed files with 22 additions and 24 deletions
|
@ -120,7 +120,7 @@ class Auth {
|
|||
if (password) {
|
||||
return res.status(401).send('Invalid root password (hint: there is none)')
|
||||
} else {
|
||||
return res.json({ user: user.toJSONForBrowser() })
|
||||
return res.json({ user: user.toJSONForBrowser(), userDefaultLibraryId: user.getDefaultLibraryId(this.db.libraries) })
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -128,7 +128,8 @@ class Auth {
|
|||
var compare = await bcrypt.compare(password, user.pash)
|
||||
if (compare) {
|
||||
res.json({
|
||||
user: user.toJSONForBrowser()
|
||||
user: user.toJSONForBrowser(),
|
||||
userDefaultLibraryId: user.getDefaultLibraryId(this.db.libraries)
|
||||
})
|
||||
} else {
|
||||
Logger.debug(`[Auth] Failed login attempt ${req.rateLimit.current} of ${req.rateLimit.limit}`)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue