What is a very simple authentication scheme for Sinatra/Rack
I am busy porting a very small web app from ASP.NET MVC 2 to Ruby/Sinatra. In the MVC app, FormsAuthentication.SetAuthCookie was being used to set a persistent cookie when the users login was validated correctly against the database. I was wondering what the equivalent of Forms Authentication would be in Sinatra? All the authentication frameworks seem very bulky and not really what I'm looking for. Here is a very simple authentication scheme for Sinatra. I’ll explain how it works below. class App < Sinatra::Base set :sessions => true register do def auth (type) condition do redirect "/login"