code: public function beginAuthentication(AuthenticationContextInterface $context): bool
      {
          $user = $context->getUser();
  
          if (!$user instanceof User) {
              return false;
          }
  
          return (bool) $user->useTwoFactor;
      }
docs: {@inheritdoc}