Skip to content

Instantly share code, notes, and snippets.

@div
Created August 23, 2013 15:11
Show Gist options
  • Save div/6320436 to your computer and use it in GitHub Desktop.
Save div/6320436 to your computer and use it in GitHub Desktop.
class ApplicationController < ActionController::Base
before_filter :authenticate
private
def authenticate
login = authenticate_or_request_with_http_basic do |username, password|
username == ENV["USERNAME"] && Digest::SHA1.hexdigest(password) == ENV["PASSWORD_HASH"]
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment