Sha256: 9660ac3097f8640a69c2d1dc62f31141ef1ba6113bb2192baf0e8f46f1829236
Contents?: true
Size: 490 Bytes
Versions: 10
Compression:
Stored size: 490 Bytes
Contents
module Vhx module Middleware class OAuth2 < Faraday::Middleware def call(env) orig_env = env.dup begin @app.call(env) rescue InvalidTokenError @vhx_client.refresh_access_token! orig_env[:request_headers].merge!(@vhx_client.configured_headers) @app.call(orig_env) end end def initialize(app, options={}) super(app) @vhx_client = options[:vhx_client] end end end end
Version data entries
10 entries across 10 versions & 1 rubygems