Skip to content

Instantly share code, notes, and snippets.

@StasKoval
Created June 2, 2014 22:43
Show Gist options
  • Save StasKoval/f039a916808b4c568a6f to your computer and use it in GitHub Desktop.
Save StasKoval/f039a916808b4c568a6f to your computer and use it in GitHub Desktop.
example simple http auth
class ApplicationController < ActionController::Base
before_filter :authenticate
protect_from_forgery with: :exception
protected
def authenticate
authenticate_or_request_with_http_basic do |username, password|
username == "user" && password == "password"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment