mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: verify presence of 'sso url' before enabling 'enable sso'
This commit is contained in:
14
lib/validators/enable_sso_validator.rb
Normal file
14
lib/validators/enable_sso_validator.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
class EnableSsoValidator
|
||||
def initialize(opts = {})
|
||||
@opts = opts
|
||||
end
|
||||
|
||||
def valid_value?(val)
|
||||
return true if val == 'f'
|
||||
SiteSetting.sso_url.present?
|
||||
end
|
||||
|
||||
def error_message
|
||||
I18n.t('site_settings.errors.sso_url_is_empty')
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user