From d669ff8ebb2d0fc780be96b18ed3eebc06c6c45e Mon Sep 17 00:00:00 2001 From: Kevin Reedy Date: Sun, 20 Dec 2020 23:02:39 -0600 Subject: [PATCH] Fix Time.now casting causing false positive in verify_at --- lib/jwt/verify.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/jwt/verify.rb b/lib/jwt/verify.rb index 7c699352..a7d52724 100644 --- a/lib/jwt/verify.rb +++ b/lib/jwt/verify.rb @@ -45,7 +45,7 @@ def verify_iat return unless @payload.include?('iat') iat = @payload['iat'] - raise(JWT::InvalidIatError, 'Invalid iat') if !iat.is_a?(Numeric) || iat.to_f > Time.now.to_f + raise(JWT::InvalidIatError, 'Invalid iat') if !iat.is_a?(Numeric) || iat.to_i > Time.now.to_i end def verify_iss