mirror of
https://github.com/heartcombo/devise.git
synced 2022-11-09 12:18:31 -05:00
27 lines
620 B
Ruby
27 lines
620 B
Ruby
|
# Taken from RailsWarden, thanks to Hassox. http://github.com/hassox/rails_warden
|
||
|
module Warden::Mixins::Common
|
||
|
# Gets the rails request object by default if it's available
|
||
|
def request
|
||
|
return @request if @request
|
||
|
if env['action_controller.rescue.request']
|
||
|
@request = env['action_controller.rescue.request']
|
||
|
else
|
||
|
Rack::Request.new(env)
|
||
|
end
|
||
|
end
|
||
|
|
||
|
def raw_session
|
||
|
request.session
|
||
|
end
|
||
|
|
||
|
def reset_session!
|
||
|
raw_session.inspect # why do I have to inspect it to get it to clear?
|
||
|
raw_session.clear
|
||
|
end
|
||
|
|
||
|
# Proxy to request cookies
|
||
|
def cookies
|
||
|
request.cookies
|
||
|
end
|
||
|
end
|