summaryrefslogtreecommitdiff
path: root/config/config.exs
diff options
context:
space:
mode:
Diffstat (limited to 'config/config.exs')
-rw-r--r--config/config.exs26
1 files changed, 16 insertions, 10 deletions
diff --git a/config/config.exs b/config/config.exs
index 03baf894d..7d8de5af6 100644
--- a/config/config.exs
+++ b/config/config.exs
@@ -381,20 +381,26 @@ config :pleroma, :ldap,
base: System.get_env("LDAP_BASE") || "dc=example,dc=com",
uid: System.get_env("LDAP_UID") || "cn"
-config :pleroma, :auth, oauth_consumer_enabled: System.get_env("OAUTH_CONSUMER_ENABLED") == "true"
+oauth_consumer_strategies = String.split(System.get_env("OAUTH_CONSUMER_STRATEGIES" || ""))
+
+ueberauth_providers =
+ for strategy <- oauth_consumer_strategies do
+ strategy_module_name =
+ System.get_env("UEBERAUTH_#{String.upcase(strategy)}_STRATEGY_MODULE") ||
+ "Elixir.Ueberauth.Strategy.#{String.capitalize(strategy)}"
+
+ strategy_module = String.to_atom(strategy_module_name)
+ {String.to_atom(strategy), {strategy_module, [callback_params: ["state"]]}}
+ end
config :ueberauth,
Ueberauth,
base_path: "/oauth",
- providers: [
- twitter:
- {Ueberauth.Strategy.Twitter,
- [callback_params: ~w[client_id redirect_uri scope scopes]]}
- ]
-
-config :ueberauth, Ueberauth.Strategy.Twitter.OAuth,
- consumer_key: System.get_env("TWITTER_CONSUMER_KEY"),
- consumer_secret: System.get_env("TWITTER_CONSUMER_SECRET")
+ providers: ueberauth_providers
+
+config :pleroma, :auth,
+ oauth_consumer_strategies: oauth_consumer_strategies,
+ oauth_consumer_enabled: oauth_consumer_strategies != []
# Import environment specific config. This must remain at the bottom
# of this file so it overrides the configuration defined above.