Small rack middleware to block your site from unwanted vistors. A little bit more convenient than basic auth - browser will ask you once for the password and then set a cookie to remember you - unlike the http basic auth it wont prompt you all the time.
Add this line to your application's Gemfile:
gem 'rack_password'
Let's assume you want to password protect your staging environemnt. Add something like this to config/environments/staging.rb
config.middleware.use RackPassword::Block, auth_codes: ['janusz']
From now on, your staging app should prompt for janusz
password before you access it.
- Fork it ( https://github.com/netguru/rack_password/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request