SECURITY: When enabled only allow Discourse Connect logins

If Discourse Connect is enabled no other methods for account creation or
authentication should be allowed.
This commit is contained in:
Blake Erickson
2024-10-24 13:06:55 -06:00
committed by =
parent 15b43a205b
commit 17bdffc900
9 changed files with 84 additions and 0 deletions

View File

@ -110,6 +110,9 @@ class Users::OmniauthCallbacksController < ApplicationController
end
def self.find_authenticator(name)
if SiteSetting.enable_discourse_connect
raise Discourse::InvalidAccess.new(I18n.t("authenticator_not_found"))
end
Discourse.enabled_authenticators.each do |authenticator|
return authenticator if authenticator.name == name
end