Skip to main content
Interface de contrôle qui permet de gérer une session d’interrogation (polling) de notifications push d’AMF (MFA). Cette interface fournit des méthodes impératives pour démarrer, arrêter et inspecter l’état d’une boucle d’interrogation de longue durée qui vérifie si un défi push d’AMF (MFA) a été approuvé.
Example
export interface MfaPushPollingControl {
  /**
   * Arrête immédiatement le processus d'interrogation.
   *
   * - Annule tout minuteur planifié ou toute requête en attente.
   * - Une fois arrêté, `isRunning()` retourne `false`.
   * - Peut être appelé plusieurs fois sans risque; les appels subséquents n'ont aucun effet.
   *
   * @example
   * ```ts
   * const control = mfaPushChallengePush.pollingManager({ intervalMs: 5000 });
   * control.startPolling();
   *
   * // Plus tard, si l'utilisateur annule :
   * control.stopPolling();
   * ```
   */
  stopPolling: () => void;

  /**
   * Starts or resumes the polling process.
   *
   * - If polling is already active, calling this again has no effect.
   * - If previously stopped, calling this restarts the polling loop.
   *
   * @example
   * ```ts
   * control.startPolling(); // Begin checking the MFA push challenge
   * ```
   */
  startPolling: () => void;

  /**
   * Indicates whether the polling process is currently running.
   *
   * - Returns `true` if polling is active and not cancelled.
   * - Returns `false` if polling has been stopped or has completed.
   *
   * @example
   * ```ts
   * if (control.isRunning()) {
   *   console.log('Polling in progress...');
   * } else {
   *   console.log('Polling is stopped or completed.');
   * }
   * ```
   */
  isRunning: () => boolean;
}

Propriétés

isRunning
boolean
Indique si le processus d’interrogation est actuellement en cours d’exécution.
Example
if (control.isRunning()) {
  console.log('Interrogation en cours...');
} else {
  console.log('L’interrogation est arrêtée ou terminée.');
}
startPolling
void
Démarre ou reprend le processus d’interrogation.
  • Si l’interrogation est déjà active, l’appeler de nouveau n’a aucun effet.
  • Si elle a été arrêtée auparavant, l’appeler redémarre la boucle d’interrogation.
Example
control.startPolling(); // Commencer à vérifier le défi AMF (MFA) par notification push
stopPolling
void
Arrête immédiatement le processus d’interrogation.
  • Annule tout minuteur programmé ou toute requête en attente.
  • Une fois arrêté, isRunning() renvoie false.
  • Vous pouvez l’appeler plusieurs fois en toute sécurité; les appels suivants n’ont aucun effet.
Example
const control = mfaPushChallengePush.pollingManager({ intervalMs: 5000 });
control.startPolling();

// Plus tard, si l’utilisateur annule :
control.stopPolling();