mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 14:12:10 +08:00
FEATURE: optional 2FA enforcement (#27506)
A new admin setting called `enforce_second_factor_on_external_auth`. It allows users to authenticate using external providers even when 2FA is forced with `enforce_second_factor` site setting.
This commit is contained in:

committed by
GitHub

parent
9568a7e542
commit
cc4c199680
@ -219,15 +219,6 @@ module SiteSettings::Validations
|
||||
if new_val != "no" && SiteSetting.enable_discourse_connect?
|
||||
return validate_error :second_factor_cannot_be_enforced_with_discourse_connect_enabled
|
||||
end
|
||||
if new_val == "all" && Discourse.enabled_auth_providers.count > 0
|
||||
auth_provider_names = Discourse.enabled_auth_providers.map(&:name).join(", ")
|
||||
return(
|
||||
validate_error(
|
||||
:second_factor_cannot_enforce_with_socials,
|
||||
auth_provider_names: auth_provider_names,
|
||||
)
|
||||
)
|
||||
end
|
||||
return if SiteSetting.enable_local_logins
|
||||
return if new_val == "no"
|
||||
validate_error :second_factor_cannot_be_enforced_with_disabled_local_login
|
||||
|
Reference in New Issue
Block a user