当我在控制器中添加authorize!
方法时,出现错误
NoMethodError - undefined method authenticated? for nil:NilClass
我的控制器
require 'rubygems'
require 'sinatra'
require 'sinatra_warden'
require 'warden'
class LoginManager < Sinatra::Base
register Sinatra::Warden
end
use Rack::Session::Pool
get '/dashboard' do
authorize!('/login')
erb :dashboard
end
sinatra_warden 0.3.2
看守1.2.6
我哪里出错?