Could someone please explain for me what is happening here?
i feel like the documentation doesnt mention a lot or describe what is happening. it just say use this method like this.
what will happen if username and password are true, what will happen if false etc?
class AdminController < ApplicationController
USERNAME, PASSWORD = "humbaba", "5baa61e4"
before_filter :authenticate
private
def authenticate
authenticate_or_request_with_http_basic do |username, password|
username == USERNAME &&
Digest::SHA1.hexdigest(password) == PASSWORD
end
end
end
thanks