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
def authenticate | |
authenticate_or_request_with_http_basic do | username,password | | |
return false if username.blank? || password.blank? | |
username.strip!.downcase! | |
# Check to see if this request provides a session cookie. | |
# If the user id is in the session database, they pass right thru | |
@current_user = User.find_by_username( session[:user_id] ) if session[:user_id] | |
return if @current_user |
NewerOlder