mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-27 11:41:36 +00:00
- 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.
8 lines
No EOL
232 B
JavaScript
8 lines
No EOL
232 B
JavaScript
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());
|
|
} |