> ## Documentation Index
> Fetch the complete documentation index at: https://docs-dev-docs-add-auth0-cli-management-api-examples.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Cas d’utilisation : Configurer un formulaire de politique de mise à jour à l’aide des formulaires.

> Configurer un formulaire de politique de mise à jour à l’aide des formulaires pour Actions.

<Card title="Avant de commencer">
  1. Créez une [application machine-machine](https://auth0.com/docs/get-started/auth0-overview/create-applications/machine-to-machine-apps) avec les permissions suivantes activées :

  * `read:users`
  * `update:users`
  * `create:users`
  * `read:users_app_metadata`
  * `update:users_app_metadata`
  * `create:users_app_metadata`

  2. Ajoutez une [Connexion au coffre-fort](/docs/fr-ca/customize/forms/vault) en utilisant les informations d’identification de l’application machine-machine (M-M).
</Card>

Les formulaires pour Actions vous permettent de créer des flux de politiques de confidentialité personnalisés et de stocker le consentement avec l’objet `app_metadata` .

<Frame>
  <img src="https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/nRFHCor-qs5SY04d/docs/images/fr-ca/cdy7uua7fh8z/6i68dMvHDTijfRmSgN1x8Q/ad900e7d4c0fb34645921435472b8684/privavy-policy-form.png?fit=max&auto=format&n=nRFHCor-qs5SY04d&q=85&s=b207e7337cde9fbe01188f69868ceb24" alt="Dashboard > Actions > Forms > Privacy policy use case" data-og-width="1404" width="1404" data-og-height="638" height="638" data-path="docs/images/fr-ca/cdy7uua7fh8z/6i68dMvHDTijfRmSgN1x8Q/ad900e7d4c0fb34645921435472b8684/privavy-policy-form.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/nRFHCor-qs5SY04d/docs/images/fr-ca/cdy7uua7fh8z/6i68dMvHDTijfRmSgN1x8Q/ad900e7d4c0fb34645921435472b8684/privavy-policy-form.png?w=280&fit=max&auto=format&n=nRFHCor-qs5SY04d&q=85&s=543907df29d6f8b6e22a65eec6b759fb 280w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/nRFHCor-qs5SY04d/docs/images/fr-ca/cdy7uua7fh8z/6i68dMvHDTijfRmSgN1x8Q/ad900e7d4c0fb34645921435472b8684/privavy-policy-form.png?w=560&fit=max&auto=format&n=nRFHCor-qs5SY04d&q=85&s=f21d4f4037f1fbf6225802c90df0063f 560w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/nRFHCor-qs5SY04d/docs/images/fr-ca/cdy7uua7fh8z/6i68dMvHDTijfRmSgN1x8Q/ad900e7d4c0fb34645921435472b8684/privavy-policy-form.png?w=840&fit=max&auto=format&n=nRFHCor-qs5SY04d&q=85&s=4ca166577154dbfaa21770d1c9c830de 840w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/nRFHCor-qs5SY04d/docs/images/fr-ca/cdy7uua7fh8z/6i68dMvHDTijfRmSgN1x8Q/ad900e7d4c0fb34645921435472b8684/privavy-policy-form.png?w=1100&fit=max&auto=format&n=nRFHCor-qs5SY04d&q=85&s=47fbf20a425e4f6858a4ae8747d49168 1100w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/nRFHCor-qs5SY04d/docs/images/fr-ca/cdy7uua7fh8z/6i68dMvHDTijfRmSgN1x8Q/ad900e7d4c0fb34645921435472b8684/privavy-policy-form.png?w=1650&fit=max&auto=format&n=nRFHCor-qs5SY04d&q=85&s=7fae5f4f065fd29f0c919953eafbe1ea 1650w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/nRFHCor-qs5SY04d/docs/images/fr-ca/cdy7uua7fh8z/6i68dMvHDTijfRmSgN1x8Q/ad900e7d4c0fb34645921435472b8684/privavy-policy-form.png?w=2500&fit=max&auto=format&n=nRFHCor-qs5SY04d&q=85&s=f5a4ff59ea6aa6bb4a09abf4ca1d6b91 2500w" />
</Frame>

Les sections ci-dessous décrivent comment créer un formulaire de politique de mise à jour en utilisant des nœuds et des flux, ainsi que les étapes pour ajouter votre formulaire à une action [post-connexion](/docs/fr-ca/customize/actions/explore-triggers/signup-and-login-triggers/login-trigger).

## Créer un formulaire à partir de zéro

Suivez ces étapes pour créer un formulaire afin de recueillir des informations :

1. Ouvrez l’éditeur de formulaires en sélectionnant **Auth0 Dashboard (tableau de bord Auth0) > Actions > Forms (formulaires).**
2. Sélectionnez **Créer un formulaire** > **Commencer à partir de zéro**.

Par défaut, un nouveau formulaire contient un nœud Début, un nœud Étape et un nœud Éran fin.

<Frame>
  <img src="https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/wLe8GOohm066767F/docs/images/fr-ca/cdy7uua7fh8z/2TZ9jSjgEcARFpULI6hz4R/a4319a1bd482f2ee5cc23100fdb2f42c/New-form-Forms-for-action-use-case.png?fit=max&auto=format&n=wLe8GOohm066767F&q=85&s=1039a92303abd888da92ed6e40256eda" alt="Dashboard > Forms > Use Cases > Form" data-og-width="1234" width="1234" data-og-height="371" height="371" data-path="docs/images/fr-ca/cdy7uua7fh8z/2TZ9jSjgEcARFpULI6hz4R/a4319a1bd482f2ee5cc23100fdb2f42c/New-form-Forms-for-action-use-case.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/wLe8GOohm066767F/docs/images/fr-ca/cdy7uua7fh8z/2TZ9jSjgEcARFpULI6hz4R/a4319a1bd482f2ee5cc23100fdb2f42c/New-form-Forms-for-action-use-case.png?w=280&fit=max&auto=format&n=wLe8GOohm066767F&q=85&s=7c2fa3be6ed3fd64d09977cde6fad6d1 280w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/wLe8GOohm066767F/docs/images/fr-ca/cdy7uua7fh8z/2TZ9jSjgEcARFpULI6hz4R/a4319a1bd482f2ee5cc23100fdb2f42c/New-form-Forms-for-action-use-case.png?w=560&fit=max&auto=format&n=wLe8GOohm066767F&q=85&s=ed09c053936f9472097ffcee7e482c13 560w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/wLe8GOohm066767F/docs/images/fr-ca/cdy7uua7fh8z/2TZ9jSjgEcARFpULI6hz4R/a4319a1bd482f2ee5cc23100fdb2f42c/New-form-Forms-for-action-use-case.png?w=840&fit=max&auto=format&n=wLe8GOohm066767F&q=85&s=a53e4d935aeffa2e78cc8e2d1bc44bb3 840w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/wLe8GOohm066767F/docs/images/fr-ca/cdy7uua7fh8z/2TZ9jSjgEcARFpULI6hz4R/a4319a1bd482f2ee5cc23100fdb2f42c/New-form-Forms-for-action-use-case.png?w=1100&fit=max&auto=format&n=wLe8GOohm066767F&q=85&s=c6fc5eb8dc2ec0be5102c2bbef508a09 1100w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/wLe8GOohm066767F/docs/images/fr-ca/cdy7uua7fh8z/2TZ9jSjgEcARFpULI6hz4R/a4319a1bd482f2ee5cc23100fdb2f42c/New-form-Forms-for-action-use-case.png?w=1650&fit=max&auto=format&n=wLe8GOohm066767F&q=85&s=b69fe5079e8496914572e9a5079b1e78 1650w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/wLe8GOohm066767F/docs/images/fr-ca/cdy7uua7fh8z/2TZ9jSjgEcARFpULI6hz4R/a4319a1bd482f2ee5cc23100fdb2f42c/New-form-Forms-for-action-use-case.png?w=2500&fit=max&auto=format&n=wLe8GOohm066767F&q=85&s=7c5f519c3f0cf4d25c87326c1629519e 2500w" />
</Frame>

### Configurer le nœud d’étape

Le nœud d’étape est l’interface graphique visible par les utilisateurs. Ajoutez des [champs](/docs/fr-ca/customize/forms/nodes-and-components) au nœud d’étape pour recueillir la nouvelle valeur d’acceptation de l’accord en suivant ces étapes :

1. Faites glisser un champ **Rich text (Texte enrichi)** depuis le **Components menu (Menu composants)** dans le nœud **d’étape**.

   * **Rich text (Texte enrichi)**: Saisissez une description des mises à jour de vos politiques de confidentialité.
   * Sélectionnez **Save (Enregistrer)**.
2. Faites glisser un champ **Legal (Légal)** dans le nœud **d’étape** .

   * **Identification** : Saisissez `privacy_policies`.
   * **Obligatoire** : Cochez la case.
   * **Légal** : Saisissez `J’accepte la politique de confidentialité`.
   * Sélectionnez **Save (Enregistrer)**.
3. Sélectionnez **Publish (Publier)** pour enregistrer.

<Frame>
  <img src="https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/kxl-mWSKwl8FQgkM/docs/images/fr-ca/cdy7uua7fh8z/59zFFjQjAnjogkc2QGIqqJ/0ad66b1b636544122aa4e65968b76c2c/privacy-policy-step-node.png?fit=max&auto=format&n=kxl-mWSKwl8FQgkM&q=85&s=c945ed674e5dcd8ea96c2e666368c911" alt="Dashboard > Actions > Forms > Use case privacy policy step node" data-og-width="1404" width="1404" data-og-height="559" height="559" data-path="docs/images/fr-ca/cdy7uua7fh8z/59zFFjQjAnjogkc2QGIqqJ/0ad66b1b636544122aa4e65968b76c2c/privacy-policy-step-node.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/kxl-mWSKwl8FQgkM/docs/images/fr-ca/cdy7uua7fh8z/59zFFjQjAnjogkc2QGIqqJ/0ad66b1b636544122aa4e65968b76c2c/privacy-policy-step-node.png?w=280&fit=max&auto=format&n=kxl-mWSKwl8FQgkM&q=85&s=6cff783e525b2e783cd52daec247c6e4 280w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/kxl-mWSKwl8FQgkM/docs/images/fr-ca/cdy7uua7fh8z/59zFFjQjAnjogkc2QGIqqJ/0ad66b1b636544122aa4e65968b76c2c/privacy-policy-step-node.png?w=560&fit=max&auto=format&n=kxl-mWSKwl8FQgkM&q=85&s=76e88aff15fc6ce53f85e3eac84ddc3f 560w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/kxl-mWSKwl8FQgkM/docs/images/fr-ca/cdy7uua7fh8z/59zFFjQjAnjogkc2QGIqqJ/0ad66b1b636544122aa4e65968b76c2c/privacy-policy-step-node.png?w=840&fit=max&auto=format&n=kxl-mWSKwl8FQgkM&q=85&s=cd6bcee6d98b1da2fff758c408c1f94a 840w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/kxl-mWSKwl8FQgkM/docs/images/fr-ca/cdy7uua7fh8z/59zFFjQjAnjogkc2QGIqqJ/0ad66b1b636544122aa4e65968b76c2c/privacy-policy-step-node.png?w=1100&fit=max&auto=format&n=kxl-mWSKwl8FQgkM&q=85&s=295e80b0fb3a6e5d4e3a1cc5d457eae3 1100w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/kxl-mWSKwl8FQgkM/docs/images/fr-ca/cdy7uua7fh8z/59zFFjQjAnjogkc2QGIqqJ/0ad66b1b636544122aa4e65968b76c2c/privacy-policy-step-node.png?w=1650&fit=max&auto=format&n=kxl-mWSKwl8FQgkM&q=85&s=84b650ccca752fc8961757fabdcaf1d7 1650w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/kxl-mWSKwl8FQgkM/docs/images/fr-ca/cdy7uua7fh8z/59zFFjQjAnjogkc2QGIqqJ/0ad66b1b636544122aa4e65968b76c2c/privacy-policy-step-node.png?w=2500&fit=max&auto=format&n=kxl-mWSKwl8FQgkM&q=85&s=788f72ae5d8771ae4aa6a98cf9b06854 2500w" />
</Frame>

### Configurez le nœud Flow

Ajoutez un node **Flow** après le nœud **d’étape** pour mettre à jour les `app_metadata` et reprendre le flux d’authentification en suivant ces étapes :

1. Sélectionnez **Flow (Flux)** en bas de Form Editor (Éditeur de formulaire).
2. Supprimez le lien existant entre les nœuds **Step (Étape)** et **Ending Screen (Écran de fin)**.
3. Sélectionnez le nouveau **Flow (Flux)** > **Click to add a flow (Cliquer pour ajouter un flux)** > **Create a new flow (Créer un nouveau flux).**

   * Entrez `Update app_metadata (Mettre à jour app_metadata)` dans le champ **Name (Nom)**.
   * Sélectionnez **Create (Créer)**.
   * Sélectionnez **Save (Enregistrer)**.
4. Liez le nœud **Flow (Flux)** aux nœuds **Step (Étape)** et **Ending Screen (Écran de fin)** comme illustré ci-dessous.
5. Sélectionnez **Publish (Publier)** pour enregistrer.

<Frame>
  <img src="https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/nRFHCor-qs5SY04d/docs/images/fr-ca/cdy7uua7fh8z/6YIkzm7SrpM9LW76AXuRzh/353c518fe82bbaa440836da1d83596d6/link-policies.png?fit=max&auto=format&n=nRFHCor-qs5SY04d&q=85&s=d35a06b1ddb826a656d5c04e24490cd2" alt="Dashboard > Actions > Forms > Form" data-og-width="1404" width="1404" data-og-height="599" height="599" data-path="docs/images/fr-ca/cdy7uua7fh8z/6YIkzm7SrpM9LW76AXuRzh/353c518fe82bbaa440836da1d83596d6/link-policies.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/nRFHCor-qs5SY04d/docs/images/fr-ca/cdy7uua7fh8z/6YIkzm7SrpM9LW76AXuRzh/353c518fe82bbaa440836da1d83596d6/link-policies.png?w=280&fit=max&auto=format&n=nRFHCor-qs5SY04d&q=85&s=a35f6a6fec2c36f839529243846ba687 280w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/nRFHCor-qs5SY04d/docs/images/fr-ca/cdy7uua7fh8z/6YIkzm7SrpM9LW76AXuRzh/353c518fe82bbaa440836da1d83596d6/link-policies.png?w=560&fit=max&auto=format&n=nRFHCor-qs5SY04d&q=85&s=d435f97de6ee6b80a9c6f751256f1016 560w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/nRFHCor-qs5SY04d/docs/images/fr-ca/cdy7uua7fh8z/6YIkzm7SrpM9LW76AXuRzh/353c518fe82bbaa440836da1d83596d6/link-policies.png?w=840&fit=max&auto=format&n=nRFHCor-qs5SY04d&q=85&s=639cab641a382bc88cb14537f32d55bb 840w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/nRFHCor-qs5SY04d/docs/images/fr-ca/cdy7uua7fh8z/6YIkzm7SrpM9LW76AXuRzh/353c518fe82bbaa440836da1d83596d6/link-policies.png?w=1100&fit=max&auto=format&n=nRFHCor-qs5SY04d&q=85&s=9b8b1611bf667caa7bfd76dbd725f467 1100w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/nRFHCor-qs5SY04d/docs/images/fr-ca/cdy7uua7fh8z/6YIkzm7SrpM9LW76AXuRzh/353c518fe82bbaa440836da1d83596d6/link-policies.png?w=1650&fit=max&auto=format&n=nRFHCor-qs5SY04d&q=85&s=8bfc039dbe5ab66c282c6a6fa6905a16 1650w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/nRFHCor-qs5SY04d/docs/images/fr-ca/cdy7uua7fh8z/6YIkzm7SrpM9LW76AXuRzh/353c518fe82bbaa440836da1d83596d6/link-policies.png?w=2500&fit=max&auto=format&n=nRFHCor-qs5SY04d&q=85&s=36dedadc393b4e34fba694d813df491c 2500w" />
</Frame>

Ajoutez une action de mise à jour d’utilisateur Auth0 au flux en suivant ces étapes :

1. Sélectionnez le **fluxUpdate app\_metadata (Mise à jour de app\_metadata)** > **Edit flow (Modifier le flux)** pour ouvrir l’éditeur de flux dans un nouvel onglet.
2. Sous l’Action **Start (Démarrage)**, sélectionnez l’icône **+** pour ajouter une Action **Update user (Mise à jour de l’utilisateur)** . Remplissez les champs ci-dessous, puis sélectionnez **Save (Enregistrer)** pour continuer.

   * **Connection** : dans la liste déroulante, sélectionnez la connexion au coffre-fort de votre application de communication entre machines.

   * **User ID** (ID utilisateur) : Saisissez `{{context.user.user_id}}`.

   * **Corps** : Copiez et collez le code suivant pour mettre à jour les app\_metadata avec les propriétés privacy\_policies et privacy\_policies\_timestamp.

     ```
     {
       "app_metadata": {
         "privacy_policies": true,
         "privacy_policies_timestamp": "{{ functions.toTimestamp() }}"
       }
     }
     ```

   * Sélectionnez **Save (Enregistrer)**.
3. Sélectionnez **Publish (Publier)** pour enregistrer.

<Frame>
  <img src="https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/8YS2R25LxIyFcDMt/docs/images/fr-ca/cdy7uua7fh8z/CvMNIwWrOUwaFW4X3G28p/1fb70ae57a20749d9ffaaba8dc0b7e26/update-user-privacy.png?fit=max&auto=format&n=8YS2R25LxIyFcDMt&q=85&s=17ee13086a2594ef86f518e648f71222" alt="Dashboard > Actions > Forms > User case privacy policy code" data-og-width="1404" width="1404" data-og-height="338" height="338" data-path="docs/images/fr-ca/cdy7uua7fh8z/CvMNIwWrOUwaFW4X3G28p/1fb70ae57a20749d9ffaaba8dc0b7e26/update-user-privacy.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/8YS2R25LxIyFcDMt/docs/images/fr-ca/cdy7uua7fh8z/CvMNIwWrOUwaFW4X3G28p/1fb70ae57a20749d9ffaaba8dc0b7e26/update-user-privacy.png?w=280&fit=max&auto=format&n=8YS2R25LxIyFcDMt&q=85&s=d8520e4bee5185413340fc0c1fe89c8a 280w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/8YS2R25LxIyFcDMt/docs/images/fr-ca/cdy7uua7fh8z/CvMNIwWrOUwaFW4X3G28p/1fb70ae57a20749d9ffaaba8dc0b7e26/update-user-privacy.png?w=560&fit=max&auto=format&n=8YS2R25LxIyFcDMt&q=85&s=d409b14f395feaa65df2187c6207187d 560w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/8YS2R25LxIyFcDMt/docs/images/fr-ca/cdy7uua7fh8z/CvMNIwWrOUwaFW4X3G28p/1fb70ae57a20749d9ffaaba8dc0b7e26/update-user-privacy.png?w=840&fit=max&auto=format&n=8YS2R25LxIyFcDMt&q=85&s=344aa4bbe983c2ffb008e19fec3c97fb 840w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/8YS2R25LxIyFcDMt/docs/images/fr-ca/cdy7uua7fh8z/CvMNIwWrOUwaFW4X3G28p/1fb70ae57a20749d9ffaaba8dc0b7e26/update-user-privacy.png?w=1100&fit=max&auto=format&n=8YS2R25LxIyFcDMt&q=85&s=8b6cbd2597d095ceafeb659ace404a1d 1100w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/8YS2R25LxIyFcDMt/docs/images/fr-ca/cdy7uua7fh8z/CvMNIwWrOUwaFW4X3G28p/1fb70ae57a20749d9ffaaba8dc0b7e26/update-user-privacy.png?w=1650&fit=max&auto=format&n=8YS2R25LxIyFcDMt&q=85&s=c776836635b28fc274db477940eaa89d 1650w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/8YS2R25LxIyFcDMt/docs/images/fr-ca/cdy7uua7fh8z/CvMNIwWrOUwaFW4X3G28p/1fb70ae57a20749d9ffaaba8dc0b7e26/update-user-privacy.png?w=2500&fit=max&auto=format&n=8YS2R25LxIyFcDMt&q=85&s=98a76a54efaa286d51f20f354d8535af 2500w" />
</Frame>

<Callout icon="file-lines" color="#0EA5E9" iconType="regular">
  Le flux **Update app\_metadata** ajoute une valeur `privacy_policies true` à l’objet `app_metadata` et génère également un horodatage à l’aide d’une [fonction d’assistance](/docs/fr-ca/customize/forms/variables)
</Callout>

## Récupérer le code de rendu du formulaire

Récupérez votre code de rendu du formulaire pour afficher visuellement le formulaire avec une Action post-connexion personnalisée en suivant ces étapes :

* Dans l’éditeur de formulaire, sélectionnez **\<> Render (Rendre)**.
* Sélectionnez **Copy (Copier)**.

<Frame>
  <img src="https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/-MbmGSrLY3cj_-ND/docs/images/fr-ca/cdy7uua7fh8z/2EIUzc539sq9lwoTKbjoJv/496a864c0fc44a782c9cadca119dbfb0/embed.png?fit=max&auto=format&n=-MbmGSrLY3cj_-ND&q=85&s=5267ce173107c33f0d2e7ff094c2be04" alt="Dashboard > Actions > Forms > Form > Embed" data-og-width="1400" width="1400" data-og-height="848" height="848" data-path="docs/images/fr-ca/cdy7uua7fh8z/2EIUzc539sq9lwoTKbjoJv/496a864c0fc44a782c9cadca119dbfb0/embed.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/-MbmGSrLY3cj_-ND/docs/images/fr-ca/cdy7uua7fh8z/2EIUzc539sq9lwoTKbjoJv/496a864c0fc44a782c9cadca119dbfb0/embed.png?w=280&fit=max&auto=format&n=-MbmGSrLY3cj_-ND&q=85&s=0029a86ad4797d2c1b39754225ca9efa 280w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/-MbmGSrLY3cj_-ND/docs/images/fr-ca/cdy7uua7fh8z/2EIUzc539sq9lwoTKbjoJv/496a864c0fc44a782c9cadca119dbfb0/embed.png?w=560&fit=max&auto=format&n=-MbmGSrLY3cj_-ND&q=85&s=cfe5d896ec546364a226ed87c802afc8 560w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/-MbmGSrLY3cj_-ND/docs/images/fr-ca/cdy7uua7fh8z/2EIUzc539sq9lwoTKbjoJv/496a864c0fc44a782c9cadca119dbfb0/embed.png?w=840&fit=max&auto=format&n=-MbmGSrLY3cj_-ND&q=85&s=6a1681dd06ba3bb345573144e5c5134c 840w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/-MbmGSrLY3cj_-ND/docs/images/fr-ca/cdy7uua7fh8z/2EIUzc539sq9lwoTKbjoJv/496a864c0fc44a782c9cadca119dbfb0/embed.png?w=1100&fit=max&auto=format&n=-MbmGSrLY3cj_-ND&q=85&s=877d947f4ff88a5526f03b617e899ae6 1100w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/-MbmGSrLY3cj_-ND/docs/images/fr-ca/cdy7uua7fh8z/2EIUzc539sq9lwoTKbjoJv/496a864c0fc44a782c9cadca119dbfb0/embed.png?w=1650&fit=max&auto=format&n=-MbmGSrLY3cj_-ND&q=85&s=a69c2f74851b61015a551ae8acdc225b 1650w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/-MbmGSrLY3cj_-ND/docs/images/fr-ca/cdy7uua7fh8z/2EIUzc539sq9lwoTKbjoJv/496a864c0fc44a782c9cadca119dbfb0/embed.png?w=2500&fit=max&auto=format&n=-MbmGSrLY3cj_-ND&q=85&s=61bd0b4c358a0d42d3f23b50112bfdd0 2500w" />
</Frame>

## Créer une action post-connexion

Créez une action post-connexion pour afficher votre formulaire en suivant ces étapes :

1. Naviguez vers **Auth0 Dashboard > Actions > Flows (Flux) > Login (Connexion).**
2. Sélectionnez l’icône **+** et choisissez **Build from scratch (Construire à partir de zéro)**:

   * **Name (Nom)** : Saisissez `Render Update Policy Form (Formulaire de politique de mise à jour du rendu)`.
   * **Déclencheur** : Sélectionnez `Login / Post Login (Connexion / Post-connexion)`.
   * **Runtime (Temps d’exécution)** : Sélectionnez la version recommandée.
3. Sélectionnez **Create (Créer)**.

Pour configurer l’action post-connexion.

1. Supprimez le code existant dans l’éditeur de code.

2. Collez le code de rendu du formulaire dans l’éditeur de code.

3. Modifiez le code pour définir la logique conditionnelle d’affichage du formulaire.

   ```javascript lines theme={null}
   /**
   * @param {Event} event - Details about the user and the context in which they are logging in.
   * @param {PostLoginAPI} api - Interface whose methods can be used to change the behavior of the login.
   */
   exports.onExecutePostLogin = async (event, api) => {
     const FORM_ID = 'REPLACE_WITH_YOUR_FORM_ID';

     if (event.user.app_metadata.privacy_policies !== true) {
       api.prompt.render(FORM_ID);
     }
   }

   exports.onContinuePostLogin = async (event, api) => { }
   ```

   <Callout icon="file-lines" color="#0EA5E9" iconType="regular">
     L’exemple de code ci-dessus affiche le formulaire lorsque la propriété `privacy_policies` ne se trouve pas dans les métadonnées de l’application.
   </Callout>

4. Sélectionnez **Deploy (Déployer)**.

5. Glissez et déposez l’Action **Render Update Policy Form (Formulaire de mise à jour de la politique de rendu)** dans le flux de **Login (Connexion)** .

   <Frame>
     <img src="https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/S9mDwCjebf9to_Nj/docs/images/fr-ca/cdy7uua7fh8z/5TOwDgevZsBqd7yZynUYWU/41ca909dc3007aed4f40ff794a05efa5/postlogin.png?fit=max&auto=format&n=S9mDwCjebf9to_Nj&q=85&s=7ded984c1b4611a2c0f84939fd6fc73e" alt="Dashboard > Forms > Use Case > Render update policy form login action" data-og-width="1370" width="1370" data-og-height="668" height="668" data-path="docs/images/fr-ca/cdy7uua7fh8z/5TOwDgevZsBqd7yZynUYWU/41ca909dc3007aed4f40ff794a05efa5/postlogin.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/S9mDwCjebf9to_Nj/docs/images/fr-ca/cdy7uua7fh8z/5TOwDgevZsBqd7yZynUYWU/41ca909dc3007aed4f40ff794a05efa5/postlogin.png?w=280&fit=max&auto=format&n=S9mDwCjebf9to_Nj&q=85&s=4353a8b8525828aefaf2664eb493783b 280w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/S9mDwCjebf9to_Nj/docs/images/fr-ca/cdy7uua7fh8z/5TOwDgevZsBqd7yZynUYWU/41ca909dc3007aed4f40ff794a05efa5/postlogin.png?w=560&fit=max&auto=format&n=S9mDwCjebf9to_Nj&q=85&s=be9aed537cbe29a9830dfba1122e37df 560w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/S9mDwCjebf9to_Nj/docs/images/fr-ca/cdy7uua7fh8z/5TOwDgevZsBqd7yZynUYWU/41ca909dc3007aed4f40ff794a05efa5/postlogin.png?w=840&fit=max&auto=format&n=S9mDwCjebf9to_Nj&q=85&s=0eb8fbcac7c359d2a193754f2fcb7ab4 840w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/S9mDwCjebf9to_Nj/docs/images/fr-ca/cdy7uua7fh8z/5TOwDgevZsBqd7yZynUYWU/41ca909dc3007aed4f40ff794a05efa5/postlogin.png?w=1100&fit=max&auto=format&n=S9mDwCjebf9to_Nj&q=85&s=cb4bf9315eb79289a7f480cd77f2ba66 1100w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/S9mDwCjebf9to_Nj/docs/images/fr-ca/cdy7uua7fh8z/5TOwDgevZsBqd7yZynUYWU/41ca909dc3007aed4f40ff794a05efa5/postlogin.png?w=1650&fit=max&auto=format&n=S9mDwCjebf9to_Nj&q=85&s=5d4c12a37e9bcaf9afc8018527823569 1650w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/S9mDwCjebf9to_Nj/docs/images/fr-ca/cdy7uua7fh8z/5TOwDgevZsBqd7yZynUYWU/41ca909dc3007aed4f40ff794a05efa5/postlogin.png?w=2500&fit=max&auto=format&n=S9mDwCjebf9to_Nj&q=85&s=98804c4d38c6c91287f3b4863727788d 2500w" />
   </Frame>

6. Sélectionnez **Apply (Appliquer).**

### Test de mise en œuvre

Testez la mise en œuvre en suivant les étapes ci-dessous :

1. Se connecter avec un utilisateur existant dont l’attribut `privacy_policies` de `app_metadata` n’a pas de valeur.
2. L’action post-connexion dans le flux de connexion rendra le formulaire et demandera l’approbation.
3. Sélectionnez **Auth0 Dashboard > User Management (Gestion des utilisateurs) > Users (Utilisateurs),** localisez l’utilisateur et vérifiez que l’attribut `app_metadata``privacy_policies` contient une valeur `true` et un horodatage.
