我已经使用Devise设置了一个认证系统。
在开发模式下,我可以成功登录,但是在staging/production环境中,即使使用有效的凭据,我也无法登录用户。
会话存储是否可能是原因?
这是我在config/initializers/session_store.rb文件中的内容:
# Be sure to restart your server when you modify this file.
Rails.application.config.session_store :cookie_store, key: '_pigo_session'
我还在config/intitializers/devise.rb文件中添加了config.http_authenticatable = false
我的staging.log文件如下:
I, [2015-06-10T16:57:20.325304 #3577] INFO -- : Started GET "/" for 69.59.28.19 at 2015-06-10 16:57:20 +0400
I, [2015-06-10T16:57:20.327106 #3577] INFO -- : Processing by OffersController#index as HTML
I, [2015-06-10T16:57:20.328034 #3577] INFO -- : Filter chain halted as #<Proc:0x007fad7d18c5b8@/home/deploy/apps/pigo/shared/bundle/ruby/2.1.0/gems/actionpack-4.1.4/lib/action_controller/metal/http_authentication.rb:71> rendered or redirected
I, [2015-06-10T16:57:20.328232 #3577] INFO -- : Completed 401 Unauthorized in 1ms (ActiveRecord: 0.0ms)