class JWT::Decode

def initialize(jwt, key, verify, options, &keyfinder)

Raises:
  • (JWT::DecodeError) - if decoding or verification fails.

Parameters:
  • keyfinder (Proc) -- an optional key finder block to dynamically find the key for verification.
  • options (Hash) -- additional options for decoding and verification.
  • verify (Boolean) -- whether to verify the token's signature.
  • key (String, Array) -- the key(s) to use for verification.
  • jwt (String) -- the JWT to decode.
def initialize(jwt, key, verify, options, &keyfinder)
  raise JWT::DecodeError, 'Nil JSON web token' unless jwt
  @token = EncodedToken.new(jwt)
  @key = key
  @options = options
  @verify = verify
  @keyfinder = keyfinder
end