FEATURE: List, revoke and reconnect associated accounts. Phase 1 (#6099)

Listing connections is supported for all built-in auth providers. Revoke and reconnect is currently only implemented for Facebook.
This commit is contained in:
David Taylor
2018-07-23 16:51:57 +01:00
committed by GitHub
parent 32062864d3
commit eda1462b3b
40 changed files with 836 additions and 240 deletions

View File

@ -199,24 +199,15 @@ module Discourse
end
def self.authenticators
# TODO: perhaps we don't need auth providers and authenticators maybe one object is enough
# NOTE: this bypasses the site settings and gives a list of everything, we need to register every middleware
# for the cases of multisite
# In future we may change it so we don't include them all for cases where we are not a multisite, but we would
# require a restart after site settings change
Users::OmniauthCallbacksController::BUILTIN_AUTH + auth_providers.map(&:authenticator)
Users::OmniauthCallbacksController::BUILTIN_AUTH + DiscoursePluginRegistry.auth_providers.map(&:authenticator)
end
def self.auth_providers
providers = []
plugins.each do |p|
next unless p.auth_providers
p.auth_providers.each do |prov|
providers << prov
end
end
providers
def self.enabled_authenticators
authenticators.select { |authenticator| authenticator.enabled? }
end
def self.cache