Class: Wurk::Web::MiddlewareStack

Inherits:
Object
  • Object
show all
Defined in:
lib/wurk/web/config.rb

Overview

Engine Rack middleware that applies the host-registered Wurk::Web.use chain (Devise/Warden/Sorcery/Rack::Auth::Basic) in front of the dashboard. Inserted ahead of Authorization so host auth runs first and its env (e.g. env['warden']) is visible to the authorization hook. The chain is built lazily on first request — after host initializers have run — then memoized on the Config.

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ MiddlewareStack

Returns a new instance of MiddlewareStack.



373
374
375
# File 'lib/wurk/web/config.rb', line 373

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



377
378
379
# File 'lib/wurk/web/config.rb', line 377

def call(env)
  Wurk::Web.config.rack_app(@app).call(env)
end