audiobookshelf/server/utils/parseBool.js
pgodwin b8d0395e6d 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.
2022-11-02 22:03:06 +10:00

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());
}