You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
806 B
26 lines
806 B
6 years ago
|
# Pleroma: A lightweight social networking server
|
||
|
# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
|
||
|
# SPDX-License-Identifier: AGPL-3.0-only
|
||
|
|
||
6 years ago
|
defmodule Pleroma.Web.Auth.Authenticator do
|
||
6 years ago
|
alias Pleroma.User
|
||
|
|
||
6 years ago
|
def implementation do
|
||
|
Pleroma.Config.get(
|
||
6 years ago
|
Pleroma.Web.Auth.Authenticator,
|
||
|
Pleroma.Web.Auth.PleromaAuthenticator
|
||
6 years ago
|
)
|
||
|
end
|
||
6 years ago
|
|
||
|
@callback get_user(Plug.Conn.t()) :: {:ok, User.t()} | {:error, any()}
|
||
6 years ago
|
def get_user(plug), do: implementation().get_user(plug)
|
||
6 years ago
|
|
||
|
@callback handle_error(Plug.Conn.t(), any()) :: any()
|
||
6 years ago
|
def handle_error(plug, error), do: implementation().handle_error(plug, error)
|
||
6 years ago
|
|
||
|
@callback auth_template() :: String.t() | nil
|
||
|
def auth_template do
|
||
|
implementation().auth_template() || Pleroma.Config.get(:auth_template, "show.html")
|
||
|
end
|
||
6 years ago
|
end
|