Class: Faraday::JWT::Request

Inherits:
Middleware
  • Object
show all
Defined in:
lib/faraday/jwt/request.rb

Instance Method Summary collapse

Constructor Details

#initialize(app = nil, signing_key: nil, signing_alg: :autodetect, content_type: 'application/jwt') ⇒ Request

Returns a new instance of Request.



6
7
8
9
10
11
# File 'lib/faraday/jwt/request.rb', line 6

def initialize(app = nil, signing_key: nil, signing_alg: :autodetect, content_type: 'application/jwt')
  super app
  @signing_key = signing_key
  @signing_alg = signing_alg
  @content_types = Array(content_type)
end

Instance Method Details

#on_request(env) ⇒ Object



13
14
15
# File 'lib/faraday/jwt/request.rb', line 13

def on_request(env)
  encode_body!(env) if encodable_content?(env)
end