Skip to content

reCAPTCHA configuration not always loaded

It's possible that Gitlab::Recaptcha.load_configurations! doesn't get called before we check an issue as spam. We should probably just load this in an initializer and call this if application settings change.

Causing 500 errors for https://gitlab.com/gitlab-com/support-forum/issues/1938.

Created by @stanhu.

Recaptcha::RecaptchaError: No public key specified.
  app/views/layouts/_recaptcha_verification.html.haml:17:in `block in _app_views_layouts__recaptcha_verification_html_haml___2050238189498902329_70126702041420'
    = recaptcha_tags
  app/views/layouts/_recaptcha_verification.html.haml:11:in `_app_views_layouts__recaptcha_verification_html_haml___2050238189498902329_70126702041420'
    = form_for form do |f|
  app/views/projects/issues/verify.html.haml:3:in `_app_views_projects_issues_verify_html_haml___3418406405895692917_70126712887860'
    = render layout: 'layouts/recaptcha_verification', locals: { spammable: @issue, form: form } do
  app/controllers/concerns/spammable_actions.rb:28:in `recaptcha_check_with_fallback'
    render :verify
  app/controllers/projects/issues_controller.rb:147:in `block (2 levels) in update'
    recaptcha_check_with_fallback { render :edit }
...
(176 additional frame(s) were not displayed)

ActionView::Template::Error: No public key specified.

ActionView::Template::Error: No public key specified.
Edited by Stan Hu