1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00
heartcombo--devise/lib/devise/hooks/forgetable.rb

10 lines
453 B
Ruby
Raw Normal View History

# Before logout hook to forget the user in the given scope, if it responds
# to forget_me! Also clear remember token to ensure the user won't be
# remembered again. Notice that we forget the user unless the record is not persisted.
# This avoids forgetting deleted users.
Warden::Manager.before_logout do |record, warden, options|
if record.respond_to?(:forget_me!)
2011-02-24 15:55:41 -05:00
Devise::Controllers::Rememberable::Proxy.new(warden).forget_me(record)
end
end