Class: JWT::Claims::IssuedAt
- Inherits:
-
Object
- Object
- JWT::Claims::IssuedAt
- Defined in:
- lib/jwt/claims/issued_at.rb
Overview
The IssuedAt class is responsible for validating the issued at claim (‘iat’) in a JWT token.
Instance Method Summary collapse
-
#verify!(context:, **_args) ⇒ nil
Verifies the issued at claim (‘iat’) in the JWT token.
Instance Method Details
#verify!(context:, **_args) ⇒ nil
Verifies the issued at claim (‘iat’) in the JWT token.
13 14 15 16 17 18 19 |
# File 'lib/jwt/claims/issued_at.rb', line 13 def verify!(context:, **_args) return unless context.payload.is_a?(Hash) return unless context.payload.key?('iat') iat = context.payload['iat'] raise(JWT::InvalidIatError, 'Invalid iat') if !iat.is_a?(::Numeric) || iat.to_f > Time.now.to_f end |