Class: AppleAuth::Conditions::AudCondition

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

Instance Method Summary collapse

Constructor Details

#initialize(jwt) ⇒ AudCondition

Returns a new instance of AudCondition.



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

def initialize(jwt)
  @aud = jwt['aud']
end

Instance Method Details

#validate!Object

Raises:



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

def validate!
  return true if @aud == AppleAuth.config.apple_client_id

  raise JWTValidationError, 'jwt_aud is different to apple_client_id'
end