diff --git a/changelog.d/ldap-error-logging.change b/changelog.d/ldap-error-logging.change new file mode 100644 index 0000000000000000000000000000000000000000..56f0e7fc3157546bd0fb9de44e01eb31c0ebcf1f --- /dev/null +++ b/changelog.d/ldap-error-logging.change @@ -0,0 +1 @@ +Improve error logging when LDAP authentication fails. diff --git a/lib/pleroma/web/auth/ldap_authenticator.ex b/lib/pleroma/web/auth/ldap_authenticator.ex index c2c5eb1e5a32757a23a7e8aeda9a7b2fc8022b50..ea5620cf60130452799e7c710bd2b4861ffff2da 100644 --- a/lib/pleroma/web/auth/ldap_authenticator.ex +++ b/lib/pleroma/web/auth/ldap_authenticator.ex @@ -91,7 +91,8 @@ defp bind_user(connection, ldap, name, password) do end error -> - error + Logger.error("Could not bind LDAP user #{name}: #{inspect(error)}") + {:error, {:ldap_bind_error, error}} end end @@ -111,7 +112,8 @@ defp register_user(connection, base, uid, name) do try_register(name, attributes) error -> - error + Logger.error("Couldn't register user because LDAP search failed: #{inspect(error)}") + {:error, {:ldap_search_error, error}} end end