HTTP Authorization helpers for Sinatra
Ruby
Switch branches/tags
Nothing to show
Latest commit a7a0efc Dec 27, 2013 @sr sr Merge pull request #4 from gpherguson/master
Update README.rdoc

README.rdoc

Sinatra Authorization

HTTP Authorization helpers for Sinatra.

Example

require "sinatra/authorization"

set :authorization_realm, "Protected zone"

helpers do
  def authorize(login, password)
    login == "admin" && password == "secret"
  end
end

get "/" do
  "Hello"
end

get "/admin" do
  login_required

  "Welcome in protected zone"
end