Method: ActionController::HttpAuthentication::Token#encode_credentials

Defined in:
lib/action_controller/metal/http_authentication.rb

#encode_credentials(token, options = {}) ⇒ Object

Encodes the given token and options into an Authorization header value.

token - String token. options - optional Hash of the options.

Returns String.



501
502
503
504
505
506
# File 'lib/action_controller/metal/http_authentication.rb', line 501

def encode_credentials(token, options = {})
  values = ["#{TOKEN_KEY}#{token.to_s.inspect}"] + options.map do |key, value|
    "#{key}=#{value.to_s.inspect}"
  end
  "Token #{values * ", "}"
end