由于rails安全问题升级后设计2.2.3,在登录前始终显示已登录的通知消息,当我尝试登录时,它返回
Started POST "/users/sign_in" for 127.0.0.1 at 2013-02-17 00:55:34 +0530
Processing by Devise::SessionsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"Uri7L+RS+l3Nwjln1cBLfwxfMWEdEYz3gWEHyXpbRPc=", "user"=>{"email"=>"abcdedf@gmail.com", "password"=>"[FILTERED]", "remember_me"=>"0"}, "commit"=>"Sign in"}
Completed 401 Unauthorized in
Rails版本:3.1.x
答案 0 :(得分:2)
这种奇怪的行为是因为控制器动作缓存,在环境/生产中禁用它.rb解决了这个问题。
答案 1 :(得分:0)
试试这个
在config / initializers / devise.rb
中默认为真。
config.http_authenticatable_on_xhr = false