Sha256: 8a5889b9f66d197e8e6bffcdbfa83b929ecb1504d90140718c31130b3e37bb59
Contents?: true
Size: 380 Bytes
Versions: 2
Compression:
Stored size: 380 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 #{Thread.current[:tumbz_access_token]}" unless Thread.current[:tumbz_access_token].nil? @app.call(env) end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
tumbz-0.0.5 | lib/tumbz/middleware/auth.rb |
tumbz-0.0.3 | lib/tumbz/middleware/auth.rb |