Sha256: c216c18f0f4c86972bc1d3d3a24bf43b31f6bbb39a1ff1a677f5ca5c59080583
Contents?: true
Size: 454 Bytes
Versions: 11
Compression:
Stored size: 454 Bytes
Contents
class Restly::Middleware attr_reader :app, :env def initialize(app) @app = app end def call(env) @env = env Restly::Base.current_token = nil token = Restly::Connection.tokenize(Restly::Base.client, self).to_hash if token[:access_token].present? && !@env['PATH_INFO'].match(/^\/assets\//) Restly::Base.current_token = token end self.app.call(env) ensure Restly::Base.current_token = nil end end
Version data entries
11 entries across 11 versions & 1 rubygems