/**
  * Check if user password is expired
  *
  * @param User $user
  * @return null|\Symfony\Component\HttpFoundation\RedirectResponse
  */
 private function checkIsPasswordExpired(User $user)
 {
     if ($user->isPasswordExpired()) {
         $this->get('session')->setFlash('error', 'Your password has expired.');
         return $this->redirect($this->generateUrl("fos_user_change_password"));
     }
     return null;
 }