aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/auth/database_authenticator.ex
diff options
context:
space:
mode:
Diffstat (limited to 'lib/pleroma/web/auth/database_authenticator.ex')
-rw-r--r--lib/pleroma/web/auth/database_authenticator.ex14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/pleroma/web/auth/database_authenticator.ex b/lib/pleroma/web/auth/database_authenticator.ex
new file mode 100644
index 000000000..69024a4ba
--- /dev/null
+++ b/lib/pleroma/web/auth/database_authenticator.ex
@@ -0,0 +1,14 @@
+defmodule Pleroma.Web.Auth.DatabaseAuthenticator do
+ alias Pleroma.User
+
+ @implementation Pleroma.Config.get(
+ Pleroma.Web.Auth.DatabaseAuthenticator,
+ Pleroma.Web.Auth.PleromaDatabaseAuthenticator
+ )
+
+ @callback get_user(Plug.Conn.t()) :: {:ok, User.t()} | {:error, any()}
+ defdelegate get_user(plug), to: @implementation
+
+ @callback handle_error(Plug.Conn.t(), any()) :: any()
+ defdelegate handle_error(plug, error), to: @implementation
+end