diff --git a/lib/jwt/claims.rb b/lib/jwt/claims.rb index 55fda678..9bb71488 100644 --- a/lib/jwt/claims.rb +++ b/lib/jwt/claims.rb @@ -17,10 +17,10 @@ module Claims VERIFIERS = { verify_expiration: ->(options) { Claims::Expiration.new(leeway: options[:exp_leeway] || options[:leeway]) }, verify_not_before: ->(options) { Claims::NotBefore.new(leeway: options[:nbf_leeway] || options[:leeway]) }, - verify_iss: ->(options) { Claims::Issuer.new(issuers: options[:iss]) }, + verify_iss: ->(options) { options[:iss] && Claims::Issuer.new(issuers: options[:iss]) }, verify_iat: ->(*) { Claims::IssuedAt.new }, verify_jti: ->(options) { Claims::JwtId.new(validator: options[:verify_jti]) }, - verify_aud: ->(options) { Claims::Audience.new(expected_audience: options[:aud]) }, + verify_aud: ->(options) { options[:aud] && Claims::Audience.new(expected_audience: options[:aud]) }, verify_sub: ->(options) { options[:sub] && Claims::Subject.new(expected_subject: options[:sub]) }, required_claims: ->(options) { Claims::Required.new(required_claims: options[:required_claims]) } }.freeze