Add:RSS feed icon over library item covers when feed is open #893

This commit is contained in:
advplyr 2022-08-05 19:23:18 -05:00
parent 2cb4f972d7
commit 24a142e718
9 changed files with 59 additions and 21 deletions

View file

@ -114,16 +114,17 @@ class Auth {
})
}
getUserLoginResponsePayload(user) {
getUserLoginResponsePayload(user, feeds) {
return {
user: user.toJSONForBrowser(),
userDefaultLibraryId: user.getDefaultLibraryId(this.db.libraries),
serverSettings: this.db.serverSettings.toJSONForBrowser(),
feeds,
Source: global.Source
}
}
async login(req, res) {
async login(req, res, feeds) {
var username = (req.body.username || '').toLowerCase()
var password = req.body.password || ''
@ -142,14 +143,14 @@ class Auth {
if (password) {
return res.status(401).send('Invalid root password (hint: there is none)')
} else {
return res.json(this.getUserLoginResponsePayload(user))
return res.json(this.getUserLoginResponsePayload(user, feeds))
}
}
// Check password match
var compare = await bcrypt.compare(password, user.pash)
if (compare) {
res.json(this.getUserLoginResponsePayload(user))
res.json(this.getUserLoginResponsePayload(user, feeds))
} else {
Logger.debug(`[Auth] Failed login attempt ${req.rateLimit.current} of ${req.rateLimit.limit}`)
if (req.rateLimit.remaining <= 2) {