omn​​iauth回拨两次

use*_*848 5 ruby ruby-on-rails omniauth ruby-on-rails-3

我使用" omn​​iauth-greenhouse gem "将oauth用于温室.但是在认证之后,我看到回调发起两次以下消息

(greenhouse) Setup endpoint detected, running now.
(greenhouse) Request phase initiated.

Started GET "/auth/greenhouse" for 127.0.0.1 at 2014-08-27 21:41:49 -0700
(greenhouse) Setup endpoint detected, running now.
(greenhouse) Callback phase initiated.
/Users/ViswaMani/futura-project-enterprise/script/rails: No such file or directory - 
(greenhouse) Callback phase initiated.
(greenhouse) Authentication failure! invalid_credentials: OAuth2::Error, <!DOCTYPE html>
Run Code Online (Sandbox Code Playgroud)

由于第二次调用,invalid_credentials即将到来.

我制作了一个新的示例应用程序,它使用了gem和相同的凭据,我能够端到端地进行授权.我不确定我的主应用程序中存在什么问题.

没有device.rb,我只在omniauth.rb中创建一次oauth,如下所示:

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :greenhouse, 'foo', 'bar',
       :scope => 'candidates.create candidates.view jobs.view',
       :provider_ignores_state => true,
       :setup => lambda { |env| env['omniauth.strategy'].options[:client_options][:site] =  'https://app.greenhouse.io' }
end
Run Code Online (Sandbox Code Playgroud)