Merge branch 'develop' into feature/database-compaction
[akkoma] / lib / pleroma / web / auth / authenticator.ex
index 1f614668cce67dc51f629f4376fc892f7218baef..89d88af3299a018763d0dd81aee19f4810f3e47c 100644 (file)
@@ -3,8 +3,8 @@
 # SPDX-License-Identifier: AGPL-3.0-only
 
 defmodule Pleroma.Web.Auth.Authenticator do
-  alias Pleroma.User
   alias Pleroma.Registration
+  alias Pleroma.User
 
   def implementation do
     Pleroma.Config.get(
@@ -31,6 +31,15 @@ defmodule Pleroma.Web.Auth.Authenticator do
 
   @callback auth_template() :: String.t() | nil
   def auth_template do
-    implementation().auth_template() || Pleroma.Config.get(:auth_template, "show.html")
+    # Note: `config :pleroma, :auth_template, "..."` support is deprecated
+    implementation().auth_template() ||
+      Pleroma.Config.get([:auth, :auth_template], Pleroma.Config.get(:auth_template)) ||
+      "show.html"
+  end
+
+  @callback oauth_consumer_template() :: String.t() | nil
+  def oauth_consumer_template do
+    implementation().oauth_consumer_template() ||
+      Pleroma.Config.get([:auth, :oauth_consumer_template], "consumer.html")
   end
 end