rootstrap/apple_sign_in

View on GitHub
lib/apple_auth/helpers/conditions/aud_condition.rb

Summary

Maintainability
A
0 mins
Test Coverage
# frozen_string_literal: true

module AppleAuth
  module Conditions
    class AudCondition
      def initialize(jwt)
        @aud = jwt['aud']
      end

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

        raise JWTValidationError, 'jwt_aud is different to apple_client_id'
      end
    end
  end
end