No commit activity in last 3 years
No release in over 3 years
HTTP Authorization helpers for Sinatra.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
 Dependencies

Runtime

>= 0.9.1.1
 Project Readme

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