Created
August 14, 2009 20:41
-
-
Save r00k/168094 to your computer and use it in GitHub Desktop.
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
def authenticate | |
return true if Rails.env.test? | |
success = authenticate_or_request_with_http_digest do |user| | |
ADMIN_CREDENTIALS[user] | |
end | |
# We have to explicitly check if success is true here because | |
# auth_or_req_w_http_digest returns a string on authorization | |
# failure (?!) | |
session[:admin] ||= success | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment