From afced03d9f3a28c215bbf5ff270f361fe5f33c0c Mon Sep 17 00:00:00 2001 From: Widee Date: Tue, 11 Mar 2025 18:18:24 +0100 Subject: [PATCH] Fix defined version 2 to 3 Fix defined version 2 to 3 and related version cakephp 4 to 5 --- docs/fr/index.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/fr/index.rst b/docs/fr/index.rst index 5108a741..fefd8587 100644 --- a/docs/fr/index.rst +++ b/docs/fr/index.rst @@ -7,9 +7,9 @@ répertoire ROOT de votre projet CakePHP (là où se trouve le fichier .. code-block:: bash - php composer.phar require "cakephp/authentication:^2.0" + php composer.phar require cakephp/authentication -La version 2 du Plugin Authentication est compatible avec CakePHP 4. +La version 3 du Plugin Authentication est compatible avec CakePHP 5. Chargez le plugin en ajoutant l'instruction suivante dans le fichier ``src/Application.php`` de votre projet:: @@ -26,7 +26,7 @@ Pour commencer ============== Le plugin d'authentification s'intègre dans votre application comme un -`middleware `_. Il +`middleware `_. Il peut aussi être utilisé comme un composant pour faciliter l'accès sans authentification. Tout d'abord, mettons en place le middleware. Dans votre **src/Application.php**, ajoutez ce qui suit aux imports de la classe:: @@ -173,7 +173,7 @@ Ensuite, nous allons ajouter une action de connexion basique à votre { $result = $this->Authentication->getResult(); // Si l'utilisateur est connecté, le renvoyer ailleurs - if ($result->isValid()) { + if ($result && $result->isValid()) { $target = $this->Authentication->getLoginRedirect() ?? '/home'; return $this->redirect($target); }