Class: Immunio::WardenUserCaller

Inherits:
Object
  • Object
show all
Defined in:
lib/immunio/plugins/warden.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ WardenUserCaller

Returns a new instance of WardenUserCaller.



61
62
63
# File 'lib/immunio/plugins/warden.rb', line 61

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



65
66
67
68
69
70
71
72
73
74
75
# File 'lib/immunio/plugins/warden.rb', line 65

def call(env)
  Request.time "plugin", "#{Module.nesting[0]}::#{__method__}" do
    # This will end up calling Warden::Manager.after_set_user above if
    # a valid session associated with a user is seen.
    env['warden'].user

    Request.pause "plugin", "#{Module.nesting[0]}::#{__method__}" do
      @app.call(env)
    end
  end
end