Created
September 22, 2011 07:46
-
-
Save nixterrimus/1234258 to your computer and use it in GitHub Desktop.
HTTP Basic Authentication
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
class PagesController < ApplicationController | |
before_filter :authenticate | |
def secret_page | |
@time = Time.now | |
end | |
protected | |
def authenticate | |
authenticate_or_request_with_http_basic do |username, password| | |
username == "admin" && password == "password" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment