I've got an event that is triggered on hook_user_login in a module.
$event_dispatcher = \Drupal::service('event_dispatcher');
$event_dispatcher->dispatch('mymodule_user_login', $event);
I also have a subscriber that I think should be catching this event.
public function mymodule_user_login(GetResponseEvent $event) {...
static function getSubscribedEvents() {
$events[KernelEvents::REQUEST][] = ['mymodule_user_login', 1];
return $events;
}
The event seems to fire when I log in, however the subscriber runs on every page load afterwards.
Do I need to somehow clear the event in the subscriber?