mirror of
https://github.com/heartcombo/devise.git
synced 2022-11-09 12:18:31 -05:00
25 lines
No EOL
512 B
Ruby
25 lines
No EOL
512 B
Ruby
module Warden::Mixins::Common
|
|
def request
|
|
@request ||= ActionDispatch::Request.new(env)
|
|
end
|
|
|
|
def reset_session!
|
|
raw_session.inspect # why do I have to inspect it to get it to clear?
|
|
raw_session.clear
|
|
end
|
|
|
|
def response
|
|
@response ||= env['action_controller.instance'].response
|
|
end
|
|
end
|
|
|
|
class Warden::SessionSerializer
|
|
def serialize(record)
|
|
[record.class, record.id]
|
|
end
|
|
|
|
def deserialize(keys)
|
|
klass, id = keys
|
|
klass.find(:first, :conditions => { :id => id })
|
|
end
|
|
end |