AP refactoring.
This commit is contained in:
parent
423194520e
commit
70024632ba
12 changed files with 334 additions and 247 deletions
|
|
@ -1,11 +1,14 @@
|
|||
defmodule Pleroma.Plugs.AuthenticationPlug do
|
||||
alias Comeonin.Pbkdf2
|
||||
import Plug.Conn
|
||||
alias Pleroma.User
|
||||
|
||||
def init(options) do
|
||||
options
|
||||
end
|
||||
|
||||
def call(%{assigns: %{user: %User{}}} = conn, _), do: conn
|
||||
|
||||
def call(conn, opts) do
|
||||
with {:ok, username, password} <- decode_header(conn),
|
||||
{:ok, user} <- opts[:fetcher].(username),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue