Skip to content

Commit 1666b74

Browse files
authored
Merge pull request #693 from WideeFr/patch-1
Fix defined version 2 to 3
2 parents aebd48b + afced03 commit 1666b74

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/fr/index.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ répertoire ROOT de votre projet CakePHP (là où se trouve le fichier
77

88
.. code-block:: bash
99
10-
php composer.phar require "cakephp/authentication:^2.0"
10+
php composer.phar require cakephp/authentication
1111
12-
La version 2 du Plugin Authentication est compatible avec CakePHP 4.
12+
La version 3 du Plugin Authentication est compatible avec CakePHP 5.
1313

1414
Chargez le plugin en ajoutant l'instruction suivante dans le fichier
1515
``src/Application.php`` de votre projet::
@@ -26,7 +26,7 @@ Pour commencer
2626
==============
2727

2828
Le plugin d'authentification s'intègre dans votre application comme un
29-
`middleware <https://book.cakephp.org/4/en/controllers/middleware.html>`_. Il
29+
`middleware <https://book.cakephp.org/5/fr/controllers/middleware.html>`_. Il
3030
peut aussi être utilisé comme un composant pour faciliter l'accès sans
3131
authentification. Tout d'abord, mettons en place le middleware. Dans votre
3232
**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
173173
{
174174
$result = $this->Authentication->getResult();
175175
// Si l'utilisateur est connecté, le renvoyer ailleurs
176-
if ($result->isValid()) {
176+
if ($result && $result->isValid()) {
177177
$target = $this->Authentication->getLoginRedirect() ?? '/home';
178178
return $this->redirect($target);
179179
}

0 commit comments

Comments
 (0)