2019-02-26 14:26:54 +01: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 14:26:54 +01:00
|
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2019-02-28 12:12:41 +01:00
|
|
|
defmodule Pleroma.Web.Auth.Authenticator do
|
2021-06-08 01:07:54 +02:00
|
|
|
@callback get_user(Plug.Conn.t()) :: {:ok, user :: struct()} | {:error, any()}
|
|
|
|
@callback create_from_registration(Plug.Conn.t(), registration :: struct()) ::
|
2019-03-15 15:08:03 +01:00
|
|
|
{:ok, User.t()} | {:error, any()}
|
2021-06-08 01:07:54 +02:00
|
|
|
@callback get_registration(Plug.Conn.t()) :: {:ok, registration :: struct()} | {:error, any()}
|
2019-02-26 13:27:01 +01:00
|
|
|
@callback handle_error(Plug.Conn.t(), any()) :: any()
|
2019-02-28 11:58:58 +01:00
|
|
|
@callback auth_template() :: String.t() | nil
|
2019-03-27 13:39:35 +01:00
|
|
|
@callback oauth_consumer_template() :: String.t() | nil
|
2019-02-26 13:27:01 +01:00
|
|
|
end
|