Commit 4e77f684 authored by Ivan Tashkinov's avatar Ivan Tashkinov

Added `auth_template/0` to DatabaseAuthenticator.

parent b6f91531
......@@ -17,4 +17,9 @@ defmodule Pleroma.Web.Auth.DatabaseAuthenticator do
@callback handle_error(Plug.Conn.t(), any()) :: any()
def handle_error(plug, error), do: implementation().handle_error(plug, error)
@callback auth_template() :: String.t() | nil
def auth_template do
implementation().auth_template() || Pleroma.Config.get(:auth_template, "show.html")
end
end
......@@ -23,4 +23,6 @@ defmodule Pleroma.Web.Auth.PleromaDatabaseAuthenticator do
def handle_error(%Plug.Conn{} = _conn, error) do
error
end
def auth_template, do: nil
end
......@@ -25,9 +25,7 @@ defmodule Pleroma.Web.OAuth.OAuthController do
available_scopes = (app && app.scopes) || []
scopes = oauth_scopes(params, nil) || available_scopes
template = Pleroma.Config.get(:auth_template, "show.html")
render(conn, template, %{
render(conn, DatabaseAuthenticator.auth_template(), %{
response_type: params["response_type"],
client_id: params["client_id"],
available_scopes: available_scopes,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment