class Cha::Middleware::ChatWorkAuthentication

@private

Constants

KEY

Public Class Methods

new(app, token) click to toggle source
Calls superclass method
# File lib/cha/middleware.rb, line 15
def initialize(app, token)
  @token = token
  super(app)
end

Public Instance Methods

call(env) click to toggle source
# File lib/cha/middleware.rb, line 20
def call(env)
  if @token
    env[:request_headers][KEY] ||= @token
  end
  @app.call(env)
end