Database authenticator behaviour / Pleroma implementation refactoring.
[akkoma] / lib / pleroma / web / auth / database_authenticator.ex
1 defmodule Pleroma.Web.Auth.DatabaseAuthenticator do
2 alias Pleroma.User
3
4 @implementation Pleroma.Config.get(
5 Pleroma.Web.Auth.DatabaseAuthenticator,
6 Pleroma.Web.Auth.PleromaDatabaseAuthenticator
7 )
8
9 @callback get_user(Plug.Conn.t()) :: {:ok, User.t()} | {:error, any()}
10 defdelegate get_user(plug), to: @implementation
11
12 @callback handle_error(Plug.Conn.t(), any()) :: any()
13 defdelegate handle_error(plug, error), to: @implementation
14 end