Sha256: df732ba807420dcce8bb0c6265e821d79319ebf6c3700f6e66e03ca4c0dcc93d

Contents?: true

Size: 438 Bytes

Versions: 5

Compression:

Stored size: 438 Bytes

Contents

require 'rest-core/middleware'

class RestCore::Oauth2Query
  def self.members; [:access_token]; end
  include RestCore::Middleware

  def call env, &k
    local = if access_token(env)
              env.merge(REQUEST_QUERY =>
                          {'access_token' => access_token(env)}.
                           merge(env[REQUEST_QUERY] || {}))
            else
              env
            end

    app.call(local, &k)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rest-core-2.0.4 lib/rest-core/middleware/oauth2_query.rb
rest-core-2.0.3 lib/rest-core/middleware/oauth2_query.rb
rest-core-2.0.2 lib/rest-core/middleware/oauth2_query.rb
rest-core-2.0.1 lib/rest-core/middleware/oauth2_query.rb
rest-core-2.0.0 lib/rest-core/middleware/oauth2_query.rb