0

デバイスでrecaptchaを使用しようとしています。コードをracaptchaに入れてフォームを送信するたびに、「recaptcha-not-reachable」というメッセージが表示されます。数日前、recaptcha は正常に機能していましたが、今では常に「recaptcha-not-reachable」というメッセージが表示されます。その理由は本当にわかりません。

見る

<div class="password">

  <p class="forgot">Forgot your password?</p>

  <hr class="style-six">

  <div class="row">
    <div class="email">
      <%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => {:id => "renew", :class => "form-horizontal", :method => :post }) do |f| %>

          <div class="control-group mailinput">
            <%= f.email_field :email, :placeholder => "Email", :autofocus => true, :required => true %>
          </div>

          <%= recaptcha_tags :display => { :theme => 'white' } %>

          <div class="control-group">
            <%= f.button "Re-new password", :class => "btn btn-primary"  %>
          </div>
      <% end %>
    </div>
  </div>

</div>

コントローラ

class PasswordsController < Devise::PasswordsController
  layout 'xxxx_layout'

  # POST /resource/password
  def create
    if verify_recaptcha
      self.resource = resource_class.send_reset_password_instructions(resource_params)
      if successfully_sent?(resource)
        respond_with({}, :location => after_sending_reset_password_instructions_path_for(resource_name))
      else
        flash.delete :recaptcha_error
        flash.now[:error] = t("error.user.noexist")
        render "passwords/new"
      end
    else
      build_resource
      clean_up_passwords(resource)
      flash.now[:alert] = "There was an error with the recaptcha code below. Please re-enter the code."
      #flash.delete :recaptcha_error
      render "passwords/new"
    end
  end

end

get 'password/new' => 'passwords#new', :as => :new_user_password
post 'password'    => 'passwords#create', :as => :user_password
get 'password/edit' => 'passwords#edit', :as => :edit_user_password
put 'password' => 'passwords#update' 

/config/initializers/recaptcha.rb

Recaptcha.configure do |config|
  config.public_key  = 'xxxxxxx'
  config.private_key = 'xxxxxxx'
  config.proxy = 'http://127.0.0.1:3000'
end

config/application.rb

require "net/http"
4

1 に答える 1