public function decoded(JWTDecodedEvent $event)
    {
        $payload = $event->getPayload();

        // Make property accessor paths compatible by converting payload to recursive associative array
        $payload = json_decode(json_encode($payload), true);

        if (!array_key_exists($this->attribute, $payload)) {
            $event->markAsInvalid();
        }

        $uuid = $payload[$this->attribute];
        $tenant = $this->tenantService->getRepository()->findBy(['uuid' => $uuid]);

        if (!$tenant) {
            $event->markAsInvalid();
        }
    }
public function decoded(JWTDecodedEvent $event)
    {
        $payload = $event->getPayload();

        // Make property accessor paths compatible by converting payload to recursive associative array
        $payload = json_decode(json_encode($payload), true);

        if (!array_key_exists($this->attribute, $payload)) {
            $event->markAsInvalid();
        }

        $uuid = $payload[$this->attribute];
        $tenant = $this->tenantService->getRepository()->findBy(['uuid' => $uuid]);

        if (!$tenant) {
            $event->markAsInvalid();
        }
    }
public function decoded ( JWTDecodedEvent $ event ) { $ payload = $ event -> getPayload ( ) ; // Make property accessor paths compatible by converting payload to recursive associative array $ payload = json_decode ( json_encode ( $ payload ) , true ) ; if ( ! array_key_exists ( $ this -> attribute , $ payload ) ) { $ event -> markAsInvalid ( ) ; } $ uuid = $ payload [ $ this -> attribute ] ; $ tenant = $ this -> tenantService -> getRepository ( ) -> findBy ( [ 'uuid' => $ uuid ] ) ; if ( ! $ tenant ) { $ event -> markAsInvalid ( ) ; } }
Mark the token as invalid if the user tenant is missing

@param \Lexik\Bundle\JWTAuthenticationBundle\Event\JWTDecodedEvent $event
Mark the token as invalid if the user tenant is missing