Class: AppleAuth::Conditions::ExpCondition

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

Instance Method Summary collapse

Constructor Details

#initialize(jwt) ⇒ ExpCondition

Returns a new instance of ExpCondition.



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

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

Instance Method Details

#validate!Object

Raises:



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

def validate!
  return true if @exp > Time.now.to_i

  raise JWTValidationError, 'Expired jwt_exp'
end