diff options
author | Ivan Tashkinov <ivant.business@gmail.com> | 2019-03-27 15:39:35 +0300 |
---|---|---|
committer | Ivan Tashkinov <ivant.business@gmail.com> | 2019-03-27 15:39:35 +0300 |
commit | 2a95014b9d7142aa2549e70f428293af78fae8eb (patch) | |
tree | 3d527bee41bcbb4fddec9251ecb18f1337bc64a2 /lib/pleroma/web/auth | |
parent | 81bf6d9e6a92b4af00b3351b043193a3c299ede5 (diff) | |
download | pleroma-2a95014b9d7142aa2549e70f428293af78fae8eb.tar.gz |
[#923] OAuth consumer improvements, fixes, refactoring.
Diffstat (limited to 'lib/pleroma/web/auth')
-rw-r--r-- | lib/pleroma/web/auth/authenticator.ex | 6 | ||||
-rw-r--r-- | lib/pleroma/web/auth/ldap_authenticator.ex | 2 | ||||
-rw-r--r-- | lib/pleroma/web/auth/pleroma_authenticator.ex | 2 |
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 |