Skip to content

Instantly share code, notes, and snippets.

@iaintshine
Created April 25, 2013 22:47
Show Gist options
  • Save iaintshine/4e03123b6ce56766b52f to your computer and use it in GitHub Desktop.
Save iaintshine/4e03123b6ce56766b52f to your computer and use it in GitHub Desktop.
Basic authentication only in production environment
class ExamplesController < ApplicationController
before_filter :authenticate_ip if Rails.env.production?
http_basic_authenticate_with :name => "login", :password => "pass" if Rails.env.production?
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment