Skip to content

A platform for community discussion. Free, open, simple.

507 B
Raw Blame
# frozen_string_literal: true

class ProblemCheck::HcaptchaConfiguration < ProblemCheck
  self.priority = "high"

  def call
    if SiteSetting.discourse_captcha_enabled &&
         SiteSetting.discourse_captcha_provider == DiscourseCaptcha::CaptchaProvider::HCAPTCHA &&
         !hcaptcha_credentials_present?
      return problem
    end

    no_problem
  end

  private

  def hcaptcha_credentials_present?
    SiteSetting.hcaptcha_site_key.present? && SiteSetting.hcaptcha_secret_key.present?
  end
end