Add external ldap enabled boolean flag

This commit is contained in:
Johannes Zellner
2019-08-29 12:28:41 +02:00
parent 7a6d26c5da
commit 567d92ce00
2 changed files with 3 additions and 0 deletions

View File

@@ -207,6 +207,7 @@ function getExternalLdapConfig(req, res, next) {
function setExternalLdapConfig(req, res, next) {
assert.strictEqual(typeof req.body, 'object');
if (typeof req.body.enabled !== 'boolean') return next(new HttpError(400, 'enabled must be a boolean'));
if (typeof req.body.url !== 'string' || req.body.url === '') return next(new HttpError(400, 'url must be a non empty string'));
if (typeof req.body.baseDn !== 'string' || req.body.baseDn === '') return next(new HttpError(400, 'baseDn must be a non empty string'));
if (typeof req.body.filter !== 'string' || req.body.filter === '') return next(new HttpError(400, 'filter must be a non empty string'));