original_string: public function onAuthenticationSuccess(AuthenticationEvent $event)
      {
          if (!$this->config['admin_login']) {
              return;
          }
  
          $token = $event->getAuthenticationToken();
          $userIsAdmin = $this->accessDecisionManager->decide($token, ['ROLE_ADMIN']);
  
          // Only for Admins and fully authenticated
          if (!($userIsAdmin && $token instanceof UsernamePasswordToken)) {
              return;
          }
  
          /** @var \Ekyna\Bundle\UserBundle\Model\UserInterface $user */
          $user = $token->getUser();
  
          $this->mailer->sendSuccessfulLoginEmailMessage($user);
      }
code: public function onAuthenticationSuccess(AuthenticationEvent $event)
      {
          if (!$this->config['admin_login']) {
              return;
          }
  
          $token = $event->getAuthenticationToken();
          $userIsAdmin = $this->accessDecisionManager->decide($token, ['ROLE_ADMIN']);
  
          // Only for Admins and fully authenticated
          if (!($userIsAdmin && $token instanceof UsernamePasswordToken)) {
              return;
          }
  
          /** @var \Ekyna\Bundle\UserBundle\Model\UserInterface $user */
          $user = $token->getUser();
  
          $this->mailer->sendSuccessfulLoginEmailMessage($user);
      }
code_tokens: public function onAuthenticationSuccess ( AuthenticationEvent $ event ) { if ( ! $ this -> config [ 'admin_login' ] ) { return ; } $ token = $ event -> getAuthenticationToken ( ) ; $ userIsAdmin = $ this -> accessDecisionManager -> decide ( $ token , [ 'ROLE_ADMIN' ] ) ; // Only for Admins and fully authenticated if ( ! ( $ userIsAdmin && $ token instanceof UsernamePasswordToken ) ) { return ; } /** @var \Ekyna\Bundle\UserBundle\Model\UserInterface $user */ $ user = $ token -> getUser ( ) ; $ this -> mailer -> sendSuccessfulLoginEmailMessage ( $ user ) ; }
docstring: Handle login success event.
  
  @param AuthenticationEvent $event
docstring_tokens: Handle login success event .