mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-27 03:31:46 +00:00
Forward Auth refactor and adding PROXY_FORWARD_AUTH_LOGOUT_URI env
This commit is contained in:
parent
8558baf30a
commit
73a61872fa
9 changed files with 139 additions and 68 deletions
|
|
@ -120,6 +120,13 @@ class MiscController {
|
|||
Logger.error('Invalid user in authorize')
|
||||
return res.sendStatus(401)
|
||||
}
|
||||
|
||||
// When authorizing an API token and forward auth is enabled then validate user using forward auth headers
|
||||
if (global.ForwardAuth.Enabled && !this.auth.validateForwardAuthUser(req)) {
|
||||
Logger.error(`[MiscController] Authorize token with forward auth enabled failed for user "${req.user.username}"`)
|
||||
return res.sendStatus(403)
|
||||
}
|
||||
|
||||
const userResponse = this.auth.getUserLoginResponsePayload(req.user, this.rssFeedManager.feedsArray)
|
||||
res.json(userResponse)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue