title: Symfony4. Force change password. Redirect to change-password site
body: <p>I build login logic myself and i don't want use FosUserBundle. </p>
  
  <p>I check Entity User date of last change password and if is more than 30 days i want that user will not fully authenticated only redirect to sites that they will must change password.</p>
  
  <p>I try to use SecurityListener and onSecurityInteractiveLogin method.
  Checking date works, but user is authenticated and redirect to sites what i configured in case after correct login (not to route change-password).</p>
  
  <pre><code>class SecurityListener
  {
      private $tokenStorage;
      private $em;
      private $session;
      private $urlGenerator;
  
      public function __construct(TokenStorage $tokenStorage, EntityManager $doctrine, Session $session, UrlGeneratorInterface $urlGenerator)
      {
          $this-&gt;tokenStorage = $tokenStorage;
          $this-&gt;em = $doctrine;
          $this-&gt;session = $session;
          $this-&gt;urlGenerator = $urlGenerator;
      }
  
      /**
       * @param InteractiveLoginEvent $event
       * @return RedirectResponse
       */
      public function onSecurityInteractiveLogin(InteractiveLoginEvent $event)
      {
          $lastPasswordAt = $this-&gt;tokenStorage-&gt;getToken()-&gt;getUser()-&gt;getlastPasswordAt();
          $data = new \DateTime("now");
          $data-&gt;modify('-30 days');
  
          if ($lastPasswordAt &lt; $data) {
              $this-&gt;session-&gt;invalidate();
              return $this-&gt;urlGenerator-&gt;generate('app_change_password');
          }
      }
  }
  </code></pre>
  
  <p>Please give me some hints how to handle this issue.</p>