Skip to content

Instantly share code, notes, and snippets.

@pmkhoa
Created January 22, 2015 18:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save pmkhoa/f6444bc4ab60c9c82df4 to your computer and use it in GitHub Desktop.
Save pmkhoa/f6444bc4ab60c9c82df4 to your computer and use it in GitHub Desktop.
Middleman Authentication via Rack
require 'rubygems'
require 'middleman/rack'
protected_middleman = Rack::Auth::Basic.new(Middleman.server) do |username, password|
[username, password] == ['theuser', 'thepassword']
end
run protected_middleman
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment