Sha256: 3eed61fa2453c7ee01ec72ac8957580bb1955333f702ca634542041db53061bf

Contents?: true

Size: 346 Bytes

Versions: 3

Compression:

Stored size: 346 Bytes

Contents

module Tumbz
  module Middleware
    class Auth < Faraday::Middleware
      def initialize(app, options={})
        @app = app
        @options = options
      end

      def call(env)
        env[:request_headers]["Authorization"] = "OAuth #{Tumbz.access_token}" unless Tumbz.access_token.nil?
        @app.call(env)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
tumbz-0.0.4 lib/tumbz/middleware/auth.rb
tumbz-0.0.2 lib/tumbz/middleware/auth.rb
tumbz-0.0.1 lib/tumbz/middleware/auth.rb