mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 06:41:25 +08:00
FIX: Error message when setting enforce 2fa with social logins (#10479)
This commit is contained in:

committed by
GitHub

parent
298ed5d021
commit
a3c0d4a8b5
@ -156,6 +156,10 @@ module SiteSettings::Validations
|
||||
end
|
||||
|
||||
def validate_enforce_second_factor(new_val)
|
||||
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