Skip to content

Latest commit

 

History

History
25 lines (17 loc) · 405 Bytes

README.rdoc

File metadata and controls

25 lines (17 loc) · 405 Bytes

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