Sinatra Authorization

HTTP Authorization helpers for Sinatra.

Example

require “sinatra/authorization”

set :authorization_realm, “Protected zone”

helpers do

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

end

get “/” do

"Hello"

end

get “/admin” do



"Welcome in protected zone"

end