commit: 63582949436c9db9c97e7269ed2124d9f649a6ef
parent 8776d31794b2a6523dd07a950f355920d2ec1192
Author: feld <feld@feld.me>
Date: Wed, 18 Sep 2024 16:20:45 +0000
Merge branch 'ldap-call' into 'develop'
LDAP: fix compile warning
See merge request pleroma/pleroma!4270
Diffstat:
3 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/changelog.d/ldap-warning.skip b/changelog.d/ldap-warning.skip
diff --git a/lib/pleroma/ldap.ex b/lib/pleroma/ldap.ex
@@ -94,6 +94,10 @@ defmodule Pleroma.LDAP do
:ok
end
+ def bind_user(name, password) do
+ GenServer.call(__MODULE__, {:bind_user, name, password})
+ end
+
defp connect do
ldap = Config.get(:ldap, [])
host = Keyword.get(ldap, :host, "localhost")
diff --git a/lib/pleroma/web/auth/ldap_authenticator.ex b/lib/pleroma/web/auth/ldap_authenticator.ex
@@ -3,6 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.Auth.LDAPAuthenticator do
+ alias Pleroma.LDAP
alias Pleroma.User
import Pleroma.Web.Auth.Helpers, only: [fetch_credentials: 1]
@@ -19,7 +20,7 @@ defmodule Pleroma.Web.Auth.LDAPAuthenticator do
def get_user(%Plug.Conn{} = conn) do
with {:ldap, true} <- {:ldap, Pleroma.Config.get([:ldap, :enabled])},
{:ok, {name, password}} <- fetch_credentials(conn),
- %User{} = user <- GenServer.call(Pleroma.LDAP, {:bind_user, name, password}) do
+ %User{} = user <- LDAP.bind_user(name, password) do
{:ok, user}
else
{:ldap, _} ->