module ActionController::HttpAuthentication::Token

def authenticate(controller, &login_procedure)


authenticate(controller) { |token, options| ... }

should take two arguments:
* +login_procedure+ - Proc to call if a token is present. The Proc
* +controller+ - ActionController::Base instance for the current request.

==== Parameters

token is found. Returns +nil+ if no token is found.
Returns the return value of +login_procedure+ if a

procedure with the present token and options.
If token Authorization header is present, call the login
def authenticate(controller, &login_procedure)
  token, options = token_and_options(controller.request)
  unless token.blank?
    login_procedure.call(token, options)
  end
end