mirror of
https://git.unistra.fr/aius/root/ldap-overleaf-sl.git
synced 2025-05-04 19:55:26 +02:00
Fix parsing the LDAP_CONTACTS environment variable
The current code skips loading contact information from LDAP if `!process.env.LDAP_CONTACTS` evaluates to `true`. This is nearly never the case, as `process.env` contains strings and non-empty strings evaluate to `true`, making the negation falsy. Only an empty string in `LDAP_CONTACTS` (or not setting the environment variable at all) skips the contact loading. This commit changes the logic to only load contacts from LDAP if the `LDAP_CONTACTS` environment variable is explicitly set to `"true"` (case insensitive). This should bring the behaviour of the application more in line with the expectation and the docs.
This commit is contained in:
parent
ba73f282ec
commit
c40b47135c
1 changed files with 1 additions and 1 deletions
|
@ -80,7 +80,7 @@ module.exports = ContactsController = {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
async getLdapContacts(contacts) {
|
async getLdapContacts(contacts) {
|
||||||
if (! process.env.LDAP_CONTACTS) {
|
if (process.env.LDAP_CONTACTS === undefined || !(process.env.LDAP_CONTACTS.toLowerCase() === 'true')) {
|
||||||
return contacts
|
return contacts
|
||||||
}
|
}
|
||||||
const client = new Client({
|
const client = new Client({
|
||||||
|
|
Loading…
Add table
Reference in a new issue