/**
  * Checks if a given password matches the user's password.
  *
  * @param UserInterface $user
  * @param string        $password
  *
  * @return bool
  */
 public function verifyPassword(UserInterface $user, $password)
 {
     $currentPassword = $user->getHashedPassword();
     if (!$currentPassword) {
         return false;
     }
     return hash_equals($currentPassword, $this->hash($password));
 }