1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Plugs.AuthenticationPlug do
14 def call(%{assigns: %{user: %User{}}} = conn, _), do: conn
19 auth_user: %{password_hash: password_hash} = auth_user,
20 auth_credentials: %{password: password}
25 if Pbkdf2.checkpw(password, password_hash) do
27 |> assign(:user, auth_user)
33 def call(%{assigns: %{auth_credentials: %{password: _}}} = conn, _) do
34 Pbkdf2.dummy_checkpw()
38 def call(conn, _), do: conn