Retain the try do so an LDAP failure can fall back to local database.

This fixes tests but the automatic fallback may not be well documented behavior.
This commit is contained in:
Mark Felder 2024-09-15 23:18:17 -04:00
parent af3bf8a462
commit 91d1d7260b

View file

@ -65,6 +65,7 @@ defp ldap_user(name, password) do
case :eldap.open([to_charlist(host)], options) do
{:ok, connection} ->
try do
cond do
ssl ->
:application.ensure_all_started(:ssl)
@ -88,6 +89,9 @@ defp ldap_user(name, password) do
end
bind_user(connection, ldap, name, password)
after
:eldap.close(connection)
end
{:error, error} ->
Logger.error("Could not open LDAP connection: #{inspect(error)}")