aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/auth
diff options
context:
space:
mode:
authorIvan Tashkinov <ivant.business@gmail.com>2019-03-27 15:39:35 +0300
committerIvan Tashkinov <ivant.business@gmail.com>2019-03-27 15:39:35 +0300
commit2a95014b9d7142aa2549e70f428293af78fae8eb (patch)
tree3d527bee41bcbb4fddec9251ecb18f1337bc64a2 /lib/pleroma/web/auth
parent81bf6d9e6a92b4af00b3351b043193a3c299ede5 (diff)
downloadpleroma-2a95014b9d7142aa2549e70f428293af78fae8eb.tar.gz
[#923] OAuth consumer improvements, fixes, refactoring.
Diffstat (limited to 'lib/pleroma/web/auth')
-rw-r--r--lib/pleroma/web/auth/authenticator.ex6
-rw-r--r--lib/pleroma/web/auth/ldap_authenticator.ex2
-rw-r--r--lib/pleroma/web/auth/pleroma_authenticator.ex2
3 files changed, 10 insertions, 0 deletions
diff --git a/lib/pleroma/web/auth/authenticator.ex b/lib/pleroma/web/auth/authenticator.ex
index 1f614668c..bb87b323c 100644
--- a/lib/pleroma/web/auth/authenticator.ex
+++ b/lib/pleroma/web/auth/authenticator.ex
@@ -33,4 +33,10 @@ defmodule Pleroma.Web.Auth.Authenticator do
def auth_template do
implementation().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(:oauth_consumer_template, "consumer.html")
+ end
end
diff --git a/lib/pleroma/web/auth/ldap_authenticator.ex b/lib/pleroma/web/auth/ldap_authenticator.ex
index 65abd7f38..8b6d5a77f 100644
--- a/lib/pleroma/web/auth/ldap_authenticator.ex
+++ b/lib/pleroma/web/auth/ldap_authenticator.ex
@@ -51,6 +51,8 @@ defmodule Pleroma.Web.Auth.LDAPAuthenticator do
def auth_template, do: nil
+ def oauth_consumer_template, do: nil
+
defp ldap_user(name, password) do
ldap = Pleroma.Config.get(:ldap, [])
host = Keyword.get(ldap, :host, "localhost")
diff --git a/lib/pleroma/web/auth/pleroma_authenticator.ex b/lib/pleroma/web/auth/pleroma_authenticator.ex
index 60847ce6a..8b190f97f 100644
--- a/lib/pleroma/web/auth/pleroma_authenticator.ex
+++ b/lib/pleroma/web/auth/pleroma_authenticator.ex
@@ -92,4 +92,6 @@ defmodule Pleroma.Web.Auth.PleromaAuthenticator do
end
def auth_template, do: nil
+
+ def oauth_consumer_template, do: nil
end