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

#raw_sessionObject



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

def raw_session
  request.session
end

#requestObject



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

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



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

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

#responseObject



21
22
23
24
25
26
27
28
# File 'lib/devise/rails/warden_compat.rb', line 21

def response
  return @response if @response
  if env['action_controller.rescue.response']
    @response = env['action_controller.rescue.response']
  else
    Rack::Response.new(env)
  end
end