我正在使用 Devise 2.0.4(带有 devise-neo4j)、Warden 1.1.1、Rails 3.2.3。
当我在未选中记住我选项的情况下登录时,我可以毫无问题地退出。
但是,当我使用记住我选项登录时,我无法退出。
挖掘代码我发现devise-2.0.4/lib/devise/hooks/forgetable.rb
( Warden::Manager.before_logout do |record, warden, options|
) 中的 before_logout 钩子是用record => nil
.
我不确定是 Devise 的 bug,Warden 的还是我的……</p>
堆栈跟踪如下:
devise-2.0.4/lib/devise/hooks/forgetable.rb:7:in `(root)'
org/jruby/RubyProc.java:258:in `call'
warden-1.1.1/lib/warden/hooks.rb:14:in `_run_callbacks'
org/jruby/RubyArray.java:1615:in `each'
warden-1.1.1/lib/warden/hooks.rb:9:in `_run_callbacks'
warden-1.1.1/lib/warden/manager.rb:53:in `_run_callbacks'
warden-1.1.1/lib/warden/proxy.rb:243:in `logout'
org/jruby/RubyArray.java:1615:in `each'
warden-1.1.1/lib/warden/proxy.rb:241:in `logout'
devise-2.0.4/lib/devise/controllers/helpers.rb:159:in `sign_out_all_scopes'
devise-2.0.4/lib/devise/controllers/helpers.rb:139:in `sign_out'
devise-2.0.4/app/controllers/devise/sessions_controller.rb:23:in `destroy'