external ldap: show proper error message on timeout

This commit is contained in:
Girish Ramakrishnan
2024-01-23 23:27:06 +01:00
parent 5240068f2f
commit 793ee38f79
3 changed files with 8 additions and 6 deletions
+2
View File
@@ -40,6 +40,8 @@ async function setConfig(req, res, next) {
if ('bindDn' in req.body && typeof req.body.bindDn !== 'string') return next(new HttpError(400, 'bindDn must be a non empty string'));
if ('bindPassword' in req.body && typeof req.body.bindPassword !== 'string') return next(new HttpError(400, 'bindPassword must be a string'));
req.clearTimeout(); // remove ldap server can take a bit to respond
const [error] = await safe(externalLdap.setConfig(req.body, AuditSource.fromRequest(req)));
if (error) return next(BoxError.toHttpError(error));