Created
February 6, 2014 20:33
-
-
Save felipecabargas/8851972 to your computer and use it in GitHub Desktop.
Simple HTTP Basic Auth snippet for RailsControllers
This file contains 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
before_filter :authenticate | |
protected | |
def authenticate | |
authenticate_or_request_with_http_basic do |username, password| | |
username == "foo" && password == "bar" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment