Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/integrity/sinatra-authorization

HTTP Authorization helpers for Sinatra
https://github.com/integrity/sinatra-authorization

Last synced: 3 months ago
JSON representation

HTTP Authorization helpers for Sinatra

Awesome Lists containing this 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