Module: Warden::Mixins::Common

Defined in:
lib/devise/rails/warden_compat.rb

Overview

Taken from RailsWarden, thanks to Hassox. github.com/hassox/rails_warden

Instance Method Summary collapse

Instance Method Details

#cookiesObject

Proxy to request cookies



23
24
25
# File 'lib/devise/rails/warden_compat.rb', line 23

def cookies
  request.cookies
end

#raw_sessionObject



13
14
15
# File 'lib/devise/rails/warden_compat.rb', line 13

def raw_session
  request.session
end

#requestObject

Gets the rails request object by default if it’s available



4
5
6
7
8
9
10
11
# File 'lib/devise/rails/warden_compat.rb', line 4

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

#reset_session!Object



17
18
19
20
# File 'lib/devise/rails/warden_compat.rb', line 17

def reset_session!
  raw_session.inspect # why do I have to inspect it to get it to clear?
  raw_session.clear
end