diff --git a/lib/auth/auth_provider.rb b/lib/auth/auth_provider.rb index 20e0e6cfbcd..ab79626b11b 100644 --- a/lib/auth/auth_provider.rb +++ b/lib/auth/auth_provider.rb @@ -17,7 +17,6 @@ class Auth::AuthProvider frame_height pretty_name_setting title_setting - enabled_setting full_screen_login full_screen_login_setting custom_url @@ -28,14 +27,6 @@ class Auth::AuthProvider attr_accessor(*auth_attributes) - def enabled_setting=(val) - Discourse.deprecate( - "(#{authenticator.name}) enabled_setting is deprecated. Please define authenticator.enabled? instead", - drop_from: "2.9.0", - ) - @enabled_setting = val - end - def background_color=(val) Discourse.deprecate( "(#{authenticator.name}) background_color is no longer functional. Please use CSS instead", diff --git a/lib/plugin/instance.rb b/lib/plugin/instance.rb index 76ed4548017..a29e5b13ab5 100644 --- a/lib/plugin/instance.rb +++ b/lib/plugin/instance.rb @@ -791,25 +791,6 @@ class Plugin::Instance provider.public_send("#{sym}=", opts.delete(sym)) if opts.has_key?(sym) end - begin - provider.authenticator.enabled? - rescue NotImplementedError - provider - .authenticator - .define_singleton_method(:enabled?) do - Discourse.deprecate( - "#{provider.authenticator.class.name} should define an `enabled?` function. Patching for now.", - drop_from: "2.9.0", - ) - return SiteSetting.get(provider.enabled_setting) if provider.enabled_setting - Discourse.deprecate( - "#{provider.authenticator.class.name} has not defined an enabled_setting. Defaulting to true.", - drop_from: "2.9.0", - ) - true - end - end - DiscoursePluginRegistry.register_auth_provider(provider) end end diff --git a/spec/lib/plugin/instance_spec.rb b/spec/lib/plugin/instance_spec.rb index 7c8050fb32c..bd72cfc57b0 100644 --- a/spec/lib/plugin/instance_spec.rb +++ b/spec/lib/plugin/instance_spec.rb @@ -324,49 +324,6 @@ TEXT end end - it "patches the enabled? function for auth_providers if not defined" do - SimpleAuthenticator = - Class.new(Auth::Authenticator) do - def name - "my_authenticator" - end - end - - plugin = Plugin::Instance.new - - # lets piggy back on another boolean setting, so we don't dirty our SiteSetting object - SiteSetting.enable_badges = false - - # No enabled_site_setting - authenticator = SimpleAuthenticator.new - plugin.auth_provider(authenticator: authenticator) - plugin.notify_after_initialize - expect(authenticator.enabled?).to eq(true) - - # With enabled site setting - plugin = Plugin::Instance.new - authenticator = SimpleAuthenticator.new - plugin.auth_provider(enabled_setting: "enable_badges", authenticator: authenticator) - plugin.notify_after_initialize - expect(authenticator.enabled?).to eq(false) - - # Defines own method - plugin = Plugin::Instance.new - - SiteSetting.enable_badges = true - authenticator = - Class - .new(SimpleAuthenticator) do - def enabled? - false - end - end - .new - plugin.auth_provider(enabled_setting: "enable_badges", authenticator: authenticator) - plugin.notify_after_initialize - expect(authenticator.enabled?).to eq(false) - end - describe "#activate!" do before do # lets piggy back on another boolean setting, so we don't dirty our SiteSetting object diff --git a/spec/requests/omniauth_callbacks_controller_spec.rb b/spec/requests/omniauth_callbacks_controller_spec.rb index e9dbb7f1587..a69a2c6845a 100644 --- a/spec/requests/omniauth_callbacks_controller_spec.rb +++ b/spec/requests/omniauth_callbacks_controller_spec.rb @@ -50,7 +50,6 @@ RSpec.describe Users::OmniauthCallbacksController do end .new - provider.enabled_setting = "ubuntu_login_enabled" provider end