Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
HTTP Authorization helpers for Sinatra
Ruby
Branch: master

Merge pull request #4 from gpherguson/master

Update README.rdoc
latest commit a7a0efc073
@sr sr authored

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
Something went wrong with that request. Please try again.