From 1ed7f15f3fce292e6231e257d419d5430ae99118 Mon Sep 17 00:00:00 2001 From: mscherer Date: Thu, 9 Apr 2026 13:06:50 +0200 Subject: [PATCH] Fix remaining identifier doc examples Follow up the identifier config documentation cleanup by updating the remaining old nested examples and correcting the malformed Authentication.Password example in authenticators.md. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- docs/en/authenticators.md | 6 ++-- docs/en/migration-from-the-authcomponent.md | 32 ++++++++++----------- docs/en/password-hashers.md | 25 ++++++++-------- 3 files changed, 31 insertions(+), 32 deletions(-) diff --git a/docs/en/authenticators.md b/docs/en/authenticators.md index d8faa648..9fbec4c2 100644 --- a/docs/en/authenticators.md +++ b/docs/en/authenticators.md @@ -536,8 +536,10 @@ $service = new AuthenticationService(); // Define identifiers $passwordIdentifier = [ 'className' => 'Authentication.Password', - 'username' => 'email', - 'password' => 'password' + 'fields' => [ + 'username' => 'email', + 'password' => 'password', + ], ]; // Load the authenticators leaving Basic as the last one. diff --git a/docs/en/migration-from-the-authcomponent.md b/docs/en/migration-from-the-authcomponent.md index c8825827..e2b75c37 100644 --- a/docs/en/migration-from-the-authcomponent.md +++ b/docs/en/migration-from-the-authcomponent.md @@ -134,14 +134,13 @@ You’ll now have to configure it this way: $service = new AuthenticationService(); // Define identifier - $passwordIdentifier = [ - 'Authentication.Password' => [ - 'fields' => [ - 'username' => 'email', - 'password' => 'password' - ] - ], - ]; +$passwordIdentifier = [ + 'className' => 'Authentication.Password', + 'fields' => [ + 'username' => 'email', + 'password' => 'password', + ], +]; // Load the authenticators. Session should be first. $service->loadAuthenticator('Authentication.Session'); @@ -159,15 +158,14 @@ $service = new AuthenticationService(); // Define identifier $passwordIdentifier = [ - 'Authentication.Password' => [ - 'resolver' => [ - 'className' => 'Authentication.Orm', - 'userModel' => 'Employees', - ], - 'fields' => [ - 'username' => 'email', - 'password' => 'password' - ] + 'className' => 'Authentication.Password', + 'resolver' => [ + 'className' => 'Authentication.Orm', + 'userModel' => 'Employees', + ], + 'fields' => [ + 'username' => 'email', + 'password' => 'password', ], ]; ``` diff --git a/docs/en/password-hashers.md b/docs/en/password-hashers.md index 9cb3ffea..646f5fd3 100644 --- a/docs/en/password-hashers.md +++ b/docs/en/password-hashers.md @@ -38,19 +38,18 @@ fallback hasher as follows: ```php $passwordIdentifier = [ - 'Authentication.Password' => [ - // Other config options - 'passwordHasher' => [ - 'className' => 'Authentication.Fallback', - 'hashers' => [ - 'Authentication.Default', - [ - 'className' => 'Authentication.Legacy', - 'hashType' => 'md5', - 'salt' => false, // turn off default usage of salt - ], - ] - ] + 'className' => 'Authentication.Password', + // Other config options + 'passwordHasher' => [ + 'className' => 'Authentication.Fallback', + 'hashers' => [ + 'Authentication.Default', + [ + 'className' => 'Authentication.Legacy', + 'hashType' => 'md5', + 'salt' => false, // turn off default usage of salt + ], + ], ], ]; ```