DEV: Remove deprecated AuthProvider#enabled_setting= (#27081)

AuthProvider#enabled_setting=, used primarily by plugins, has been deprecated since version 2.9, in favour of Authenticator#enabled?. This PR confirms we are seeing no more usage and removes the method.
This commit is contained in:
Ted Johansson
2024-05-20 18:10:15 +08:00
committed by GitHub
parent 9302187ca4
commit 32aaf2e8d3
4 changed files with 0 additions and 72 deletions

View File

@ -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