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