Class: Faraday::JWT::Response

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

Instance Method Summary collapse

Constructor Details

#initialize(app = nil, verification_key: :skip_verification, signing_algs: nil, content_type: 'application/jwt') ⇒ Response

Returns a new instance of Response.



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

def initialize(app = nil, verification_key: :skip_verification, signing_algs: nil, content_type: 'application/jwt')
  super app
  @verification_key = verification_key
  @signing_algs = signing_algs
  @content_types = Array(content_type)
end

Instance Method Details

#on_complete(env) ⇒ Object



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

def on_complete(env)
  decode_body!(env) if decodable_content?(env)
end