From 176b73e591e2c7d9ab149679ce804224e7a2f3f8 Mon Sep 17 00:00:00 2001 From: txj Date: Mon, 1 Sep 2025 14:29:08 +0200 Subject: [PATCH] Update password-hashers.rst Fix problems with examples when using the preferred 3.3.x configuration pattern. --- docs/en/password-hashers.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/en/password-hashers.rst b/docs/en/password-hashers.rst index e5f44aa9..90306560 100644 --- a/docs/en/password-hashers.rst +++ b/docs/en/password-hashers.rst @@ -47,7 +47,8 @@ fallback hasher as follows:: 'passwordHasher' => [ 'className' => 'Authentication.Fallback', 'hashers' => [ - 'Authentication.Default' => [ + 'Authentication.Default', + [ 'className' => 'Authentication.Legacy', 'hashType' => 'md5', 'salt' => false, // turn off default usage of salt @@ -68,8 +69,7 @@ password needs to be upgraded:: // regardless of POST or GET, redirect if user is logged in if ($result->isValid()) { - // Assuming you are using the `Password` identifier. - if ($authentication->identifiers()->get('Password')->needsPasswordRehash()) { + if ($authentication->getIdentificationProvider()->needsPasswordRehash()) { // Rehash happens on save. $user = $this->Users->get($authentication->getIdentity()->getIdentifier()); $user->password = $this->request->getData('password');