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:
parent
af3bf8a462
commit
91d1d7260b
1 changed files with 23 additions and 19 deletions
|
@ -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)}")
|
||||
|
|
Loading…
Reference in a new issue