mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 09:26:54 -06:00
22 lines
524 B
Ruby
22 lines
524 B
Ruby
# frozen_string_literal: true
|
|
|
|
class GoogleOauth2HdGroupsValidator
|
|
def initialize(opts = {})
|
|
@opts = opts
|
|
end
|
|
|
|
def valid_value?(value)
|
|
@valid =
|
|
value == "f" ||
|
|
(
|
|
SiteSetting.google_oauth2_hd.present? &&
|
|
SiteSetting.google_oauth2_hd_groups_service_account_admin_email.present? &&
|
|
SiteSetting.google_oauth2_hd_groups_service_account_json.present?
|
|
)
|
|
end
|
|
|
|
def error_message
|
|
I18n.t("site_settings.errors.google_oauth2_hd_groups") if !@valid
|
|
end
|
|
end
|