This is an example implementation of authentication in Sinatra. It comes complete with integration, and unit tests using RSpec and Capybara, and uses ActiveRecord as an ORM.
My intention is that this code can be used, or built upon in your own Sinatra applications. Feel free to contribute suggestions, fixes, and comments via pull requests, or the issue tracker.
Here is how to use it.
git clone firstname.lastname@example.org:nickbarth/SinatraAuth.git cd SinatraAuth bundle
Generate the database
And run it!
$ thin start >> Using rack adapter >> Thin web server (v1.5.0 codename Knife) >> Maximum connections set to 1024 >> Listening on 0.0.0.0:3000, CTRL+C to stop
WTFPL © 2012 Nick Barth