[#923] Support for multiple (external) registrations per user via Registration.

This commit is contained in:
Ivan Tashkinov 2019-03-18 17:23:38 +03:00
commit 26b6354095
9 changed files with 93 additions and 50 deletions

View file

@ -15,10 +15,10 @@ defmodule Pleroma.Web.Auth.Authenticator do
@callback get_user(Plug.Conn.t(), Map.t()) :: {:ok, User.t()} | {:error, any()}
def get_user(plug, params), do: implementation().get_user(plug, params)
@callback get_or_create_user_by_oauth(Plug.Conn.t(), Map.t()) ::
@callback get_by_external_registration(Plug.Conn.t(), Map.t()) ::
{:ok, User.t()} | {:error, any()}
def get_or_create_user_by_oauth(plug, params),
do: implementation().get_or_create_user_by_oauth(plug, params)
def get_by_external_registration(plug, params),
do: implementation().get_by_external_registration(plug, params)
@callback handle_error(Plug.Conn.t(), any()) :: any()
def handle_error(plug, error), do: implementation().handle_error(plug, error)