code: public function created(JWTCreatedEvent $event)
      {
          $data = $event->getData();
  
          foreach ($this->removed as $property) {
              if (!array_key_exists($property, $data)) {
                  throw new OutOfRangeException('Property does not exist.');
              }
  
              unset($data[$property]);
          }
  
          $event->setData($data);
      }
docs: Modify the jwt token
  
  @param \Lexik\Bundle\JWTAuthenticationBundle\Event\JWTCreatedEvent $event
  @throws \OutOfRangeException