2019-02-26 13:26:54 +00:00
|
|
|
# Pleroma: A lightweight social networking server
|
2022-02-26 06:11:42 +00:00
|
|
|
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
|
2019-02-26 13:26:54 +00:00
|
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2019-02-28 11:12:41 +00:00
|
|
|
defmodule Pleroma.Web.Auth.Authenticator do
|
2021-06-07 23:07:54 +00:00
|
|
|
@callback get_user(Plug.Conn.t()) :: {:ok, user :: struct()} | {:error, any()}
|
|
|
|
@callback create_from_registration(Plug.Conn.t(), registration :: struct()) ::
|
2019-03-15 14:08:03 +00:00
|
|
|
{:ok, User.t()} | {:error, any()}
|
2021-06-07 23:07:54 +00:00
|
|
|
@callback get_registration(Plug.Conn.t()) :: {:ok, registration :: struct()} | {:error, any()}
|
2019-02-26 12:27:01 +00:00
|
|
|
@callback handle_error(Plug.Conn.t(), any()) :: any()
|
2019-02-28 10:58:58 +00:00
|
|
|
@callback auth_template() :: String.t() | nil
|
2019-03-27 12:39:35 +00:00
|
|
|
@callback oauth_consumer_template() :: String.t() | nil
|
2019-02-26 12:27:01 +00:00
|
|
|
end
|