Class: AppleAuth::Conditions::ExpCondition
- Inherits:
-
Object
- Object
- AppleAuth::Conditions::ExpCondition
- Defined in:
- lib/apple_auth/helpers/conditions/exp_condition.rb
Instance Method Summary collapse
-
#initialize(jwt) ⇒ ExpCondition
constructor
A new instance of ExpCondition.
- #validate! ⇒ Object
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
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 |