mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-27 03:31:46 +00:00
Add support for forward proxy auth. Tested with authentik.
- adds new method (`getUserFromProxyAuth) to server/Auth.js to check for relevant environment variables and pull the user from the request headers.. - adds `/forwardauth` route to call new proxy auth method - modified /client/login.vue to call `/forwardauth` and authenticate the user if returned by forwardauth - add a helper method in `server/utils/parseBool.js` to help check for boolean values from environment - update the readme.md to explain how enable forward auth.
This commit is contained in:
parent
765a11f135
commit
b8d0395e6d
5 changed files with 111 additions and 0 deletions
8
server/utils/parseBool.js
Normal file
8
server/utils/parseBool.js
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
const true_values = ["true", "yes", "y", "1", "on"];
|
||||
|
||||
module.exports.parseBool = (value) => {
|
||||
if (Object.is(value, null) || value === undefined) {
|
||||
return false;
|
||||
}
|
||||
return true_values.includes(String(value).toLowerCase());
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue