Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def add_auth_details_to_options(options)
- return unless @auth_details
- if @auth_details.has_key? :access_token
- options[:headers] = {
- "Authorization" => "Bearer #{@auth_details[:access_token]}" }
- elsif @auth_details.has_key? :api_key
- if not options.has_key? :basic_auth
- options[:basic_auth] = {
- :username => @auth_details[:api_key], :password => 'x' }
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement