You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and implemented my class (still WIP, so I know that the description and infos are not really helpful right now)
<?php
namespace App\Resolver;
use Xiidea\EasyAuditBundle\Resolver\EventResolverInterface;
use Symfony\Component\EventDispatcher\Event;
class JWTEventResolver implements EventResolverInterface
{
public function getEventLogInfo(Event $event, $eventName)
{
return array(
'description'=>'JWT description',
'type'=>$eventName
);
}
}
I'm getting the following errors
TypeError: Argument 1 passed to Xiidea\EasyAuditBundle\Listener\LogEventsListener::resolveEventHandler() must be an instance of Symfony\Component\EventDispatcher\Event, instance of Lexik\Bundle\JWTAuthenticationBundle\Event\AuthenticationFailureEvent given, called in /var/www/html/vendor/symfony/event-dispatcher/Debug/WrappedListener.php on line 126
TypeError: Argument 1 passed to Xiidea\EasyAuditBundle\Listener\LogEventsListener::resolveEventHandler() must be an instance of Symfony\Component\EventDispatcher\Event, instance of Lexik\Bundle\JWTAuthenticationBundle\Event\JWTCreatedEvent given, called in /var/www/html/vendor/symfony/event-dispatcher/Debug/WrappedListener.php on line 126
Doing some reverse engeneering brught me to the fact that those event classes are all extensions of this base class of JWT namespace
<?php
namespace Lexik\Bundle\JWTAuthenticationBundle\Event;
use Symfony\Component\EventDispatcher\Event as BaseEvent;
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Contracts\EventDispatcher\Event as ContractsBaseEvent;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
if (is_subclass_of(EventDispatcher::class, EventDispatcherInterface::class)) {
class Event extends ContractsBaseEvent
{
}
} else {
class Event extends BaseEvent
{
}
}
In fact, if I "patch" this declaration forcing it to be extended from BaseEvent, it starts involving my custom dispatchers correctly
Is there a way to avoid this behaviour? I know it sounds like a Lexik problem, but I think it could involve any custom event using contracts and could be useful to provide an integration.
The text was updated successfully, but these errors were encountered:
Hi everybody,
I'm having some troubles using this bundle to log JWT authentication events (using lexik/jwt-authentication-bundle).
Following the cookbook, I declared my custom resolvers
registered my service
and implemented my class (still WIP, so I know that the description and infos are not really helpful right now)
I'm getting the following errors
TypeError: Argument 1 passed to Xiidea\EasyAuditBundle\Listener\LogEventsListener::resolveEventHandler() must be an instance of Symfony\Component\EventDispatcher\Event, instance of Lexik\Bundle\JWTAuthenticationBundle\Event\AuthenticationFailureEvent given, called in /var/www/html/vendor/symfony/event-dispatcher/Debug/WrappedListener.php on line 126
TypeError: Argument 1 passed to Xiidea\EasyAuditBundle\Listener\LogEventsListener::resolveEventHandler() must be an instance of Symfony\Component\EventDispatcher\Event, instance of Lexik\Bundle\JWTAuthenticationBundle\Event\JWTCreatedEvent given, called in /var/www/html/vendor/symfony/event-dispatcher/Debug/WrappedListener.php on line 126
Doing some reverse engeneering brught me to the fact that those event classes are all extensions of this base class of JWT namespace
In fact, if I "patch" this declaration forcing it to be extended from BaseEvent, it starts involving my custom dispatchers correctly
Is there a way to avoid this behaviour? I know it sounds like a Lexik problem, but I think it could involve any custom event using contracts and could be useful to provide an integration.
The text was updated successfully, but these errors were encountered: