Sample code to use Omniauth in conjunction with Sinatra.
Watch Railcast to get an idea of how Omniauth can be used in Ruby.
Take a look at the code to understand rest of it.
Few things added
- Use of Twitter Bootstrap(CDN reference)
- Customized log in and registration page
- Use of Identity Strategy
- Simple role based sinatra routes.
rake db:create_migration # create an ActiveRecord migration rake db:migrate # migrate the database (use version with VERSION=n) rake db:rollback # roll back the migration (use steps with STEP=n)
Access irb console
To be able to do some dirty checks
irb load 'app.rb' u = User.all