A Sinatra (github.com/sinatra/sinatra) module that provides authentication for your Sinatra application through Warden (github.com/hassox/warden).
require 'sinatra' require 'sinatra_warden' class Application < Sinatra::Base register Sinatra::Warden get '/admin' do authorize!('/login') # require session, redirect to '/login' instead of work haml :admin end get '/dashboard' do authorize! # require a session for this action haml :dashboard end end
Please read the wiki (wiki.github.com/jsmestad/sinatra_warden) for more information on more advanced configurations.
$ git clone git://github.com/jsmestad/sinatra_warden.git $ cd sinatra_warden $ bundle install $ bundle exec rake
-
Fork the project.
-
Make your feature addition or bug fix.
-
Add tests for it. This is important so I don’t break it in a future version unintentionally.
-
Commit, do not mess with rakefile, version, or history.
-
Send me a pull request. Bonus points for topic branches.
-
Justin Smestad (github.com/jsmestad)
-
Daniel Neighman (github.com/hassox)
-
Shane Hanna (github.com/shanna)
-
Alex - crhym3 (github.com/crhym3)
Copyright © 2009 Justin Smestad. See LICENSE for details.