Class: AppleAuth::Conditions::IatCondition

Inherits:
Object
  • Object
show all
Defined in:
lib/apple_auth/helpers/conditions/iat_condition.rb

Instance Method Summary collapse

Constructor Details

#initialize(jwt) ⇒ IatCondition

Returns a new instance of IatCondition.



6
7
8
# File 'lib/apple_auth/helpers/conditions/iat_condition.rb', line 6

def initialize(jwt)
  @iat = jwt['iat'].to_i
end

Instance Method Details

#validate!Object

Raises:



10
11
12
13
14
# File 'lib/apple_auth/helpers/conditions/iat_condition.rb', line 10

def validate!
  return true if @iat <= Time.now.to_i

  raise JWTValidationError, 'jwt_iat is greater than now'
end