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