From 641e13496e6cf5480f1d9e23fa05a7ecffc91595 Mon Sep 17 00:00:00 2001 From: Julien Fontanet Date: Mon, 28 Dec 2015 10:18:47 +0100 Subject: [PATCH] Return null instead of throwing when no matches. --- packages/xo-server-auth-ldap/src/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/xo-server-auth-ldap/src/index.js b/packages/xo-server-auth-ldap/src/index.js index 4f3103d90..1092eafc4 100644 --- a/packages/xo-server-auth-ldap/src/index.js +++ b/packages/xo-server-auth-ldap/src/index.js @@ -146,7 +146,7 @@ class AuthLdap { async _authenticate ({ username, password }) { if (username === undefined || password === undefined) { - throw null + return null } const client = createClient(this._clientOpts) @@ -192,7 +192,7 @@ class AuthLdap { } catch (_) {} } - throw null + return null } finally { client.unbind() }