Module: JwtClaims::Claim::Jti

Defined in:
lib/jwt_claims/claim/jti.rb

Overview

JWT ID

Class Method Summary collapse

Class Method Details

.reject?(jti, options = {}) ⇒ true, false

Returns whether to reject the claim.

Parameters:

  • jti (String)

    a unique identifier for the JWT

  • options (Hash) (defaults to: {})

    (key jti:) expected JWT ID to match with claim

Returns:

  • (true, false)

    whether to reject the claim



14
15
16
17
# File 'lib/jwt_claims/claim/jti.rb', line 14

def reject?(jti, options = {})
  expected_jti = options.fetch(:jti, nil)
  !StringOrUri.present_and_equal?(jti, expected_jti)
end