Created
June 2, 2014 22:43
-
-
Save StasKoval/f039a916808b4c568a6f to your computer and use it in GitHub Desktop.
example simple http auth
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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