apps/web/application.rb
controller.prepare do
use YourApp::WardenImpl::WebManager
include YourApp::WardenImpl::WardenHelper
authentication_via :web_strategy
auth_failure_to "/login"
before :authenticate! # run an authentication before callback
end