Skip to content

Instantly share code, notes, and snippets.

Created November 2, 2012 17:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/4003039 to your computer and use it in GitHub Desktop.
Save anonymous/4003039 to your computer and use it in GitHub Desktop.
require 'rack/lobster'
class MyBasic < Rack::Auth::Basic
def valid?(auth)
@authenticator.call(auth.credentials[0], auth.credentials[1], auth.request)
end
end
use Rack::ShowExceptions
use MyBasic, "Lobster 2.0" do |username, password|
'secret' == password
end
run Rack::Lobster.new
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment